3.1.4 Configuring Git

Settings apply to any repository on your computer, unless you leave out the --global option.

You first need configure some basic settings required for keeping track of commit authors:

git config --global user.name "John Smith"
git config --global user.email john@example.com

It is also recommended to enable colored output:

git config --global color.ui auto

If none of your editor-related environment variables are set, the default text editor used for writing commit messages, etc., is usually vim. If your are not familiar with it, change it to an editor that you are comfortable with; for example, Gedit:

git config --global core.editor "gedit --wait --new-window"

Finally, and in some ways most importantly, let’s make sure that we can easily see the state of our working copy. If you are not using LilyDev or Windows, add the following lines to your ~/.bashrc:

export PS1="\u@\h \w\$(__git_ps1)$ "
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWUPSTREAM=auto

After starting a new terminal, your prompt will show the current branch (this term and others are explained below). Additionally, some symbols next to the branch name indicate certain states. A star “*” means that there are unstaged changes. With a plus “+”, the changes are staged. If there are untracked files, a percent “%” will appear. Finally, we can also see the state of the local repository compared to upstream: “=” means up to date, “<” is behind, “>” is ahead, “<>” means they have diverged.

You may need to install the additional bash-completion package.


LilyPond Contributor’s Guide v2.25.22 (development-branch).