Skip to content

Instantly share code, notes, and snippets.

@AndreiTelteu
Last active February 10, 2018 18:06
Show Gist options
  • Save AndreiTelteu/5e2749e05c0f91deea942826cde3bf0b to your computer and use it in GitHub Desktop.
Save AndreiTelteu/5e2749e05c0f91deea942826cde3bf0b to your computer and use it in GitHub Desktop.
My git prompt script
#!/bin/bash
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -O .bash_git_prompt;
cat >> .bash_profile <<EOF
source ~/.bash_git_prompt
export GIT_PS1_SHOWCOLORHINTS=true
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWUPSTREAM="auto"
export PROMPT_COMMAND='__git_ps1 "\n\[\e[32m\]\u@\h\[\e[0m\]: \[\e[33m\]\w\[\e[0m\]" "\n\$ "'
EOF

Run command:

$ bash <(curl -L -s https://goo.gl/eax5A8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment