Skip to content

Instantly share code, notes, and snippets.

@dundee
Forked from lexaurin/gist:943888
Last active September 25, 2015 15:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dundee/944044 to your computer and use it in GitHub Desktop.
Save dundee/944044 to your computer and use it in GitHub Desktop.
Shows actual git branch on command prompt
export PS1="$PS1\$(\
export GIT_BRANCH=\"\$(git branch --no-color 2>/dev/null | grep '*' | cut -d\" \" -f2-)\"; \
if [ -n \"\$GIT_BRANCH\" ] ; then \
echo -en \"\[\033[01;33m\]\"\$GIT_BRANCH \"> \[\033[00m\]\"; \
fi \
)"
@dundee
Copy link
Author

dundee commented Apr 27, 2011

Just paste it to the end of your ~/.bashrc script.

@mivasi
Copy link

mivasi commented Apr 27, 2011

Super, ta zmena pomohla i me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment