Skip to content

Instantly share code, notes, and snippets.

@danmindru
Created July 26, 2019 09:30
Show Gist options
  • Save danmindru/fb8d8bed57233698effa589c4229cfd5 to your computer and use it in GitHub Desktop.
Save danmindru/fb8d8bed57233698effa589c4229cfd5 to your computer and use it in GitHub Desktop.
Git config on WSL
[alias]
co = checkout
st = status
bo = checkout -b
unstage = reset HEAD --
last = !"git nlg -1 HEAD"
view-last = !"git view HEAD"
slg = log --oneline --graph --decorate # simple log
nlg = !"git pretty-log" # nice log that also works with bare bash
view = !"git pretty-view" # nice view of commits
undo-cm = reset --soft HEAD~1 # undo last commit, leaving files in index
nuke-cm = reset --hard HEAD~1 # undo last commit and clear index (including current files)
remove-cm = reset HEAD~1 # undo last commit, maintain index (files in that commit *won't* be added to index, see undo-cm for that)
# Pretty formatting commands below
pretty-log = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
pretty-view = show --format=format:'\n%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
quick-stats = ! /usr/local/bin/git-quick-stats
[core]
autocrlf = true
editor = nano
safecrlf = false
[push]
default = simple
[credential]
helper = cache --timeout=3600
[merge]
tool = meld
[mergetool "meld"]
path = /mnt/c/Program\\ Files\\ \\(x86\\)/Meld/Meld.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment