{"id":1590,"date":"2020-11-10T20:41:33","date_gmt":"2020-11-10T20:41:33","guid":{"rendered":"https:\/\/jan.schnasse.org\/blog\/?p=1590"},"modified":"2026-09-28T11:38:32","modified_gmt":"2026-09-28T09:38:32","slug":"1590","status":"publish","type":"post","link":"https:\/\/jan.schnasse.org\/blog\/2020\/11\/10\/1590\/","title":{"rendered":"How I git."},"content":{"rendered":"<p>I always like this practical insights:<\/p>\n<p><a href=\"https:\/\/daniel.haxx.se\/blog\/2020\/11\/09\/this-is-how-i-git\/\">https:\/\/daniel.haxx.se\/blog\/2020\/11\/09\/this-is-how-i-git\/<\/a><\/p>\n<p>Exclusively use git via console with modified prompt. Same here!<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">scm_info(){\n    git_info=`git branch 2&gt;\/dev\/null | sed -e '\/^[^*]\/d' -e 's\/* \\(.*\\)\/\\1\/'`\n  if [ \"${git_info}\" ]; then\n    if [ \"$(git status -s)\" ]; then\n      git_color='\\033[1;31m'\n    else\n      git_color='\\033[1;36m'\n    fi\n    echo -e \"${git_color}git:${git_info}\"\n  fi\n}\n\nPS1='\\n\\[\\033[1;32m\\][\\w] $(scm_info)\\[\\033[0m\\]\\n\\$ '\n\n<\/pre>\n<p>My advice for beginners is: 1. Do not hesitate to bring all sort of command line tools into position. Git offers nice tools for many situations but you don&#8217;t have to use them all. 2. Branch, Branch, Branch &#8211; it will help you to go back.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I always like this practical insights: https:\/\/daniel.haxx.se\/blog\/2020\/11\/09\/this-is-how-i-git\/ Exclusively use git via console with modified prompt. Same here! scm_info(){ git_info=`git branch 2&gt;\/dev\/null | sed -e &#8218;\/^[^*]\/d&#8216; -e &#8217;s\/* \\(.*\\)\/\\1\/&#8217;` if [ &#8222;${git_info}&#8220; ]; then if [ &#8222;$(git status -s)&#8220; ]; then git_color=&#8217;\\033[1;31m&#8216; else git_color=&#8217;\\033[1;36m&#8216; fi echo -e &#8222;${git_color}git:${git_info}&#8220; fi } PS1=&#8217;\\n\\[\\033[1;32m\\][\\w] $(scm_info)\\[\\033[0m\\]\\n\\$ &#8218; My advice for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1590","post","type-post","status-publish","format-standard","hentry","category-development"],"_links":{"self":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/comments?post=1590"}],"version-history":[{"count":1,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1590\/revisions"}],"predecessor-version":[{"id":4059,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1590\/revisions\/4059"}],"wp:attachment":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/media?parent=1590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/categories?post=1590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/tags?post=1590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}