It’s been just shy of five years since I first blogged about my .gitconfig file, so I figured now would be a good time to revisit it. If you’re not already aware, you can set git configuration values in a .gitconfig file in your home directory, and have them apply to all git repositories you work on. This is particularly useful for aliases and to set your email address.
My current .gitconfig:
[user]
name = James Bowes
email = $EMAIL_ADDRESS
[alias]
ci = commit -a
co = checkout
st = status
praise = blame
br = branch
diffstat = diff --stat
cat = !cat @
ds = diff --stat
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
[apply]
whitespace = warn
[diff]
rename = copy
renamelimit = 600
[pager]
color = true
[color]
branch = auto
diff = auto
interactive =auto
status = auto
[push]
default = upstream
[github]
user = jbowes
token = $GITHUB_TOKEN
I cribbed _lol _and lola from Adrian. Naturally, there’s now a github section. I get the most use out of diff.renamelimit, which helps me when I’m doing merges in large projects like Candlepin, and the ds alias, which gives me a good overview of how much work I’ve done prior to a commit.