Script for basic git configuration

While setting up my new developer VM I came to the point where I had to configure git again. As I keep on configuring git on several VMs and systems required for and provided by my clients, I thought it might be a good idea to create a small shell script which sets up my standard configuration.

Options I normally use are:

# Set username
git config user.name

# Set user email
git config user.email

# Set standard editor
git config core.editor

# Activate colors in output
git config color.ui true

# Some helpful aliases
git config alias.s status
git config alias.au '!git add -u && git status'
git config alias.spull 'svn rebase'
git config alias.spush 'svn dcommit'

Based on this collection I developed a small shell script which you can find here (released under GNU GPLv3): git-init-config

It asks for user name, email and your favourite editor. You can either apply the configuration per git repository or globally (see option –global).

Leave a Reply