Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active March 10, 2021 21:22
Show Gist options
  • Save plembo/21cb521b2d9c1d34c0565afc64fcf65e to your computer and use it in GitHub Desktop.
Save plembo/21cb521b2d9c1d34c0565afc64fcf65e to your computer and use it in GitHub Desktop.
Installing bash-git-prompt

Installing bash-git-prompt

bash-git-prompt example image

On one level, bash-git-prompt isn't very impressive. The changes it makes to your terminal aren't the kind of eye candy other, more ambitious, shell prompt customizers like Powerline and its derivatives provide. But it is useful.

In fact, for me it turns out to be more useful than Powerline because it conveys a lot of information while remaining relatively unobtrusive. It also doesn't require any special fonts.

Steps to install and enable it on Linux, from the README on github:

  1. Download the repo into the root of your user's home directory as a "dot" folder:
$ git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
  1. Tack this initializing code to the end of your user's .bashrc:
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
    GIT_PROMPT_ONLY_IN_REPO=1
    source $HOME/.bash-git-prompt/gitprompt.sh
fi

That's it!

There are a number of tweaks you can make to it, but for me the defaults work just fine.

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