Skip to content

Instantly share code, notes, and snippets.

@mmahalwy
Created April 21, 2016 21:29
Show Gist options
  • Save mmahalwy/8815bc496c91a4e8b72ad9e0c59193a4 to your computer and use it in GitHub Desktop.
Save mmahalwy/8815bc496c91a4e8b72ad9e0c59193a4 to your computer and use it in GitHub Desktop.
Awesome .gitconfig
[alias]
l = log --pretty=format:\"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]\" --decorate
g = log --oneline --decorate --graph
s = status -sb
co = checkout
b = branch -avv
ll = log --pretty=format:\"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]\" --decorate --numstat
lds = log --pretty=format:\"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]\" --decorate --date=short
ld = log --pretty=format:\"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]\" --decorate --date=relative
lc = log master..
filelog = log -u
fl = log -u
dl = !git ll -1
cp = cherry-pick
st = status
cl = clone
ci = commit
br = branch
pur = pull --rebase
la = !git config -l | grep alias | cut -c 7-
diffs = !git diff | subl
branchdiff = log --graph --left-right --cherry-pick --oneline
sps = !git stash -u && git pull --rebase && git stash apply
apc = !git add -A && git commit && git pull --rebase && git push
ada = add --all :/
pr = !f() { git fetch origin refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f
cleanb = !git remote update -p; git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
squash = "!f(){ git reset --soft HEAD~$(git rev-list --count master...) && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
[rerere]
enabled = true
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "status"]
added = green
changed = blue
untracked = magenta
deleted = red
[format]
pretty = "Commit: %C(yellow)%H%nAuthor: %C(green)%aN <%aE>%nDate: (%C(red)%ar%Creset) %ai%nSubject: %s%n%n%b"
name = Mohamed El Mahallawy
[user]
name = mmahalwy
[core]
editor = subl -w
excludesfile = ~/.gitignore
[push]
default = simple
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment