Skip to content

Instantly share code, notes, and snippets.

@Shobhit1
Last active February 18, 2020 05:58
Show Gist options
  • Save Shobhit1/2ff172ea44331288487dd95ae676ac80 to your computer and use it in GitHub Desktop.
Save Shobhit1/2ff172ea44331288487dd95ae676ac80 to your computer and use it in GitHub Desktop.
My Git Config
[alias]
c = commit -m
up = pull
p = push
s = status
co = checkout
st = status
br = branch
nb = checkout -b
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"
brall = "!git for-each-ref --sort=committerdate refs/heads/ --color --format='%(HEAD)%(color:red)%(objectname:short)%(color:reset);%(color:yellow)%(refname:short)%(color:reset);(%(color:green)%(committerdate:relative)%(color:reset));%(color:magenta)%(upstream:remotename)%(color:reset);%(color:blue)%(authorname)%(color:reset);%(color:bold white)%(contents:subject)' | column -t -s ';'"
rank = shortlog -sn --no-merges
f = fetch -p # Fetch from a repository and prune any remote-tracking references that no longer exist on the remote.
sclone = clone --depth=1
reup = rebase-update # depot_tools specific
lol = log --oneline --graph --decorate --all
df = diff --color --color-words --abbrev
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
hist = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
sync-fork = "!git pull && git fetch upstream && git checkout master && git rebase upstream/master && git push"
[fetch]
prune = true
[core]
excludesfile = /Users/terminator/.gitignore_global
gpgsign = true
editor = code --wait
# so much color
[color "diff"]
meta = yellow bold
commit = green bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "status"]
added = yellow
changed = green
untracked = cyan
[gpg]
program = gpg2
[commit]
gpgsign = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment