Global configuration goes to ~/.gitconfig. This can be edited by git commands or by hand.

Following commands will set up basic user info:

git config --global "John Doe"
git config --global ""

In config, it looks like this:

name = John Doe
email =

Let’s fill the rest directly.


# Too long to type...
ci = commit
co = checkout
cp = cherry-pick
ds = diff --name-status
st = status
su = submodule update --init --recursive
id = rev-parse HEAD
info = remote show origin
tree = log --graph --stat

# List branches. This alias is safer than using `branch` directly,
# it won't create a new (weirdly named) branch if you mistype the args.
branches = branch -vv
bl = branch -vv

# Remove all merged branches
bc = !git branch -q --merged | grep -v '^[*+]' | grep -v '\\bmaster\\b' | xargs git branch -d

# Prune after fetch/pull (git remote prune origin)
# Set this if you don't like zombie remotes.
prune = true


editor = mcedit