Skip to content

Instantly share code, notes, and snippets.

@stuarthendren
Last active December 25, 2015 13:09
Show Gist options
  • Save stuarthendren/6982126 to your computer and use it in GitHub Desktop.
Save stuarthendren/6982126 to your computer and use it in GitHub Desktop.
windows .gitconfig
[user]
name = [name]
email = [email]
[core]
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:\\dev\\kdiff3\\kdiff3.exe
keepBackup = false
trustExitCode = false
[mergetool "tortoise"]
cmd = 'C:/Program Files (x86)/Tortoise/TortoiseMerge.exe' -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"
[alias]
la = "!git config -l | grep alias | cut -c 7-"
ls = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
fl = log -u
dlc = diff --cached HEAD^
cp = cherry-pick
st = status -s
stn = "!git st | cat -n"
ci = commit
cim = "!cim() { git commit -m \"$1\"; }; cim"
cia = commit --amend --no-edit
co = checkout
mb = checkout -B
cb = "!cb() { git checkout $1 -- $2; }; cb"
br = branch
diff = diff --color --word-diff
re = reset
re1 = reset HEAD^
reh = reset --hard
rec = !git reh && git clean -fd
review = "!review() { git push origin HEAD:refs/for/$1; }; review"
draft = "!draft() { git push origin HEAD:refs/drafts/$1; }; draft"
r = rebase
ri = "!ri() { git rebase -i HEAD~$1; }; ri"
ra = rebase --abort
rc = rebase --continue
mt = mergetool
rmall = "!git status -s | grep '^ D' | awk -F' ' '{ print $2 }' | xargs git rm"
s = "!stage() { git add `git st | sed -n $1p | awk -F' ' '{ print $2 }'`; git st; }; stage"
u = "!unstage() { git reset HEAD `git st | sed -n $1p | awk -F' ' '{ print $2 }'`; git st; }; unstage"
aa = !git add -u && git add . && git st
grep = grep -Ii
f = "!git ls-files | grep --color -i"
k = !gitk
who = shortlog -n -s --no-merges
addx = update-index --chmod=+x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment