Skip to content

Instantly share code, notes, and snippets.

@dineshba
Created April 1, 2017 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dineshba/c514850048fd66d8bf1e69b3e90ddf23 to your computer and use it in GitHub Desktop.
Save dineshba/c514850048fd66d8bf1e69b3e90ddf23 to your computer and use it in GitHub Desktop.
[github]
user = dineshba
[user]
name = Dinesh Balasubramanian
email = dineshudt17@gmail.com
[core]
pager = less -FRX
#editor = atom --wait
editor = vi
autocrlf = input
[color]
ui = 4
diff = auto
status = auto
branch = auto
interactive = auto
[alias]
ec = config --global -e
f = "!git ls-files | grep -i"
branchdel = "!sh -c 'git push origin --delete $0; git branch -D $0'"
latest = !sh -c 'git log $1@{1}..$1@{0} "$@"'
what = show -s --pretty='tformat:%h (%s, %ad)' --date=short
who = shortlog -s --
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
standup = log --since 1.week.ago --author
l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset' --abbrev-commit
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
mn = merge --no-commit
cn = cherry-pick --no-commit
cr = cherry-pick
ci = commit -m
co = checkout
cl = clone
st = status
sts = status --short
b = branch
d = diff
dc = diff --cached
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
amend = commit --amend
amq = commit --amend --no-edit --quiet
unstage = reset HEAD --
diff = diff --word-diff
grep = grep -Ii
pend = !sh -c 'git log origin/"$1".."$1"' -
fo = fetch --all --tags
rpo = remote prune origin
in = log --reverse ..@{u}
inp = log -p --reverse ..@{u}
inc = diff ..@{u}
out = log --reverse @{u}..
outp = log -p --reverse @{u}..
g = grep --break --heading --line-number
sf = submodule foreach
cc = "!du -sh .git; git gc --aggressive --prune=now; du -sh .git;"
# check if the specified branch has had a commit in the past 100 days and if so, report
# old = "!sh -c '[[ \"`git log $0/$1 --since 100.days -1 | wc -l`\" -eq 0 ]] && echo \"Will need to delete $0/$1\" && git push $0 --delete $1'"
old = "!sh -c '[[ \"`git log $0/$1 --since 100.days -1 | wc -l`\" -eq 0 ]] && echo \"Will need to delete $0/$1\"'"
# [siu = submodule init update] Runs submodule-initialisation and update after a fresh checkout RECURSIVE!
siu = "!git submodule update --init --recursive; git sf \"git siu\""
# Push all submodules
pushsub = sf "git push"
# Pull all submodules
pullsub = sf "git pull"
[status]
showUntrackedFiles = all
submodulesummary = true
[push]
default = tracking
[pull]
rebase = true
[branch]
autosetupmerge = true
autosetuprebase = always
[merge]
defaultToUpstream = true
[fetch]
prune = true
[help]
autocorrect = 1
[gc]
pruneexpire = now
[grep]
extendRegexp = true
lineNumber = true
[tag]
sort = version:refname
[rebase]
autosquash = true
[filter "lfs"]
required = true
clean = git-lfs clean %f
smudge = git-lfs smudge %f
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment