Introduction
Git rewards command-line fluency. A few small habits make day-to-day work dramatically faster and safer. This page collects the highest-impact tips for new users.
Always know where you are
Add Git status to your shell prompt. Bash and Zsh both ship contrib scripts:
# bash
source /usr/share/git/completion/git-prompt.sh
PS1='\w$(__git_ps1 " (%s)")\$ '
# zsh with oh-my-zsh: enable the git plugin in ~/.zshrc
Now the current branch and dirty state are visible at all times.