12/28/2015 - 9:16 AM

Git configuration

Git configuration

Step by Step: Git configuration on Ubuntu

General Git configuration.
Configure your user name and password to be visible as the author of your commits:
git config --global "Your user name"
git config --global ""

Configure gedit as editor for git purposes (for example editing comments).
vi is used by default, so if you don't like it proceed with this step:
git config --global core.editor gedit

Configure KDiff3 as differences viewer and merging editor.
Git comes with its own terminal-based tool, but working with KDiff3 is much more comfortable:
git config --global diff.tool kdiff3
git config --global merge.tool kdiff3

Configure your Termial prompt to include current branch name.
It is very comfortable to have branch name displayed in Terminal prompt if you are inside Git workspace. To enable this just edit your ~/.bashrc file and include $(__git_ps1 " (%s)")\$ in your PS1 definition. For example:
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 " (%s)")\$ '