Skip to content

Instantly share code, notes, and snippets.

@roparz roparz/.gitconfig
Last active Apr 18, 2019

What would you like to do?
Git config
st = status
ci = commit
co = checkout
br = branch
rz = reset --hard HEAD
unwip = reset HEAD^
pr = pull --rebase
pf = push --force-with-lease
cp = cherry-pick
oops = commit --amend --no-edit
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lgl = log --color --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges
lgm = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lgml = log --color --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
wip = !git add --all && git ci -m "WIP:wip"
amend = !git add --all && git ci --amend
erase = !git amend && git push -f
rmtag = "!f() {\
git fetch --tags;\
git tag -d ${tag};\
git push origin :refs/tags/${tag};\
}; f"
uptag = "!f() {\
git fetch --tags;\
git tag -d ${tag};\
git push origin :refs/tags/${tag};\
git tag ${tag};\
git push --tags;\
}; f"
fix = "!f() {\
orig=$(git rev-parse --abbrev-ref HEAD);\
git checkout -b ${branch};\
git add --all;\
git commit;\
git push --set-upstream origin ${branch};\
git checkout ${orig};\
}; f"
brm = "!f() {\
git branch -D ${branch};\
git push origin :${branch};\
}; f"
rebase-branch = "!f() {\
if [ ! $1 ]; then exit 0; fi;\
orig=$(git rev-parse --abbrev-ref HEAD);\
git pull --rebase;\
git checkout ${branch};\
git pull --rebase origin ${orig} || exit 0;\
git push -f;\
git checkout ${orig};\
git rebase ${branch};\
git push;\
git branch -D ${branch};\
git push origin :${branch};\
}; f"
ls = show --stat --oneline
undo = "!f() {\
git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}};\
}; f"
helper = osxkeychain
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta
old = red
new = green
[color "status"]
added = yellow
changed = green
untracked = cyan
default = simple
editor = nano
whitespace = trailing-space
autocrlf = input
ignorecase = false
prune = true
[remote "origin"]
fetch = +refs/tags/*:refs/tags/*
autocorrect = 1
sslverify = false
showUntrackedFiles = all
diff = diff-so-fancy | less --tabs=4 -RFX
show = diff-so-fancy | less --tabs=4 -RFX
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
gpgsign = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.