Skip to content

Instantly share code, notes, and snippets.

@mastilver
Last active August 4, 2021 15:44
Show Gist options
  • Save mastilver/659d71579d2b10cff2c3 to your computer and use it in GitHub Desktop.
Save mastilver/659d71579d2b10cff2c3 to your computer and use it in GitHub Desktop.
My git config
[push]
default = simple
[pull]
rebase = true
[fetch]
prune = true
[alias]
sb = status -sb
undo = reset --hard HEAD
# http://stackoverflow.com/a/9074343/3052444
graph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
# https://gist.github.com/gnarf/5406589#file-gitconfig-L2
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
# https://stackoverflow.com/a/17843908/3052444
checkout-parent = "!f() { git checkout $(git show-branch | grep '\\*' | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//'); }; f"
[merge]
tool = kdiff3
[mergetool]
keepBackup = false
[help]
autoCorrect = 1
[core]
editor = vim
filemode = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment