October 2016
Beginner
861 pages
20h 37m
English
Another cool feature Git provides is to have the prompt display status information if the current working directory is a Git repository.
For the status information prompt to work, we also need to source another file, git-prompt.sh, which is usually distributed with the Git installation and located in the same directory as the completion file.
In your .bashrc or .zshrc file, add the following code snippet, again depending on your shell and the location of the git-prompt.sh file:
if [ -f /etc/bash_completion.d/git-prompt.sh ]; then source /etc/bash_completion.d/git-prompt.sh fi
To make use of the command prompt, we must change the PS1 variable; usually this is set to something ...