Skip to content

Instantly share code, notes, and snippets.

@bhuber
Last active Aug 25, 2017
Embed
What would you like to do?
My git config, provides some nice shortcuts and features
# If you decide to use this, make sure you change name, email,
# and possibly editor first
[user]
name = Bennet Huber
email = bennet.huber@gmail.com
#Add colors to your ~/.gitconfig file:
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "status"]
added = yellow
changed = green
untracked = cyan
#Highlight whitespace in diffs
[color]
ui = true
[color "diff"]
whitespace = red reverse
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
editor = vim
pager = less -FMRiX
excludesfile = ~/.gitignore
#autocrlf = true
#Add aliases to your ~/.gitconfig file:
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
dc = diff --cached
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = ls-files
ss = stash save
sp = stash pop
pr = pull --rebase
puoh = push -u origin HEAD
pfoh = push -f origin HEAD
cp = cherry-pick
rh = reset --hard
ua = "!git ss; git pr; git smu; git sp"
sm = submodule
smu = submodule update --init
smur = submodule update --recursive
sms = submodule sync
fa = fetch --all
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbs = rebase --skip
# Show files ignored by git:
ign = ls-files -o -i --exclude-standard
permission-reset = "git pull diff -p | grep -E '^(diff|old mode|new mode)' | sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' | git apply"
dag = log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order
[push]
default = simple
[amazon]
append-cr-url = true
pull-request-by-default = true
setup-crv = true
[rerere]
enabled = true
[pull]
rebase = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment