{"id":543,"date":"2011-08-09T08:14:59","date_gmt":"2011-08-09T16:14:59","guid":{"rendered":"http:\/\/blog.portnumber53.com\/?p=543"},"modified":"2011-08-09T08:14:59","modified_gmt":"2011-08-09T16:14:59","slug":"gitbasic-settings","status":"publish","type":"post","link":"https:\/\/blog.portnumber53.com\/index.php\/2011\/08\/09\/gitbasic-settings\/","title":{"rendered":"Git::Basic settings"},"content":{"rendered":"<p>Add <a href=\"https:\/\/gist.github.com\/75436\" target=\"_blank\" rel=\"noopener\">.git_completion.sh<\/a> to your home directory, and add this to your .bash_profile:<\/p>\n<p>&nbsp;<\/p>\n<pre>source ~\/.git_completion.sh\n\nfunction parse_git_dirty {\n  [[ $(git status 2> \/dev\/null | tail -n1) != \"nothing to commit (working directory clean)\" ]] &amp;&amp; echo &quot;*&quot;\n}\n\nfunction parse_git_branch {\n  git branch --no-color 2&gt; \/dev\/null | sed -e &#39;\/^[^*]\/d' -e \"s\/* \\(.*\\)\/[\\1$(parse_git_dirty)]\/&quot;\n}\n\nexport PS1=&#39;\\h:\\W$(__git_ps1 &quot;[\\[\\e[0;32m\\]%s\\[\\e[0m\\]\\[\\e[0;33m\\]$(parse_git_dirty)\\[\\e[0m\\]]&quot;)$ &#39;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Add .git_completion.sh to your home directory, and add this to your .bash_profile: &nbsp; source ~\/.git_completion.sh function parse_git_dirty { [[ $(git status 2> \/dev\/null | tail -n1) != &#8220;nothing to commit (working directory clean)&#8221; ]] &amp;&amp; echo &quot;*&quot; } function parse_git_branch { git branch &#8211;no-color 2&gt; \/dev\/null | sed -e &#39;\/^[^*]\/d&#8217;&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/blog.portnumber53.com\/index.php\/2011\/08\/09\/gitbasic-settings\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9],"tags":[63,159,160,280],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-development","category-git","tag-branch","tag-git","tag-git_completion","tag-prompt"],"_links":{"self":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/comments?post=543"}],"version-history":[{"count":0,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/543\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/media?parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/categories?post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/tags?post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}