A better setup for Git

Git default configuration is good but it can be personalized to improve your workflow efficiency. Here are some good lines to put in your ~/.gitconfig:

Click here to see this Gist on Github

# The basics, who you commit as:
name = John Doe
email = john@doe.org
# Your Github username
user = githubusername
# Some aliases to save 1000s keystrokes each year:
log = log --color
co = checkout
br = branch
ci = commit
st = status
# Long but worth it, gives you output like:
# * 4be77ea Add issue 42. 4 weeks ago by Julien
lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen%ar%Creset by %C(yellow)%an%Creset' --abbrev-commit
# Convenient to see diff in minified files
dw = diff --color-words
# Add colors
ui = true
diff = auto
# Avoid messy merge commits with autorebase
autosetuprebase = always
# Push the current branch by default
default = current
# Guess what you really meant
autocorrect = 1
# Tell git you have a global .gitignore
excludesfile = ~/.gitignore
# Remove usage hints
statusHints = false
# Tell where are the diff from,
# instead of using a and b notation
mnemonicprefix = true
Like what you read? Give Julien Buty a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.