Skip to content

Instantly share code, notes, and snippets.

@alechill
Last active December 10, 2015 15:23
Show Gist options
  • Select an option

  • Save alechill/22b35e81aea852b166d0 to your computer and use it in GitHub Desktop.

Select an option

Save alechill/22b35e81aea852b166d0 to your computer and use it in GitHub Desktop.
Set up git prompt

Single liner script to fetch and setup the useful git-prompt and git-completion utilities with your bash profile prompt

To use:

  • Copy script, paste on command line, hit enter

Enjoy:

  • Pretty colours man
  • Clear directory path info
  • If in git controlled dir, the current branch name (yay!)
  • Hit tab when typing git commands to complete the commands, remotes, and branch names (soo goddamn yay!)

Example: username@computername: ~/current/dir/path (master) $

touch ~/.bash_profile && (curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash) && (curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh > ~/.git-prompt.sh) && (echo 'source ~/.git-completion.bash' >> ~/.bash_profile) && (echo 'source ~/.git-prompt.sh' >> ~/.bash_profile) && (curl https://gist.githubusercontent.com/alechill/e5f81cb926ec51992a10/raw/f2cb767cec2406c4e14346335ab8e4a271abccb5/prompt.sh >> ~/.bash_profile) && source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment