Skip to content

Instantly share code, notes, and snippets.

@tuononh
Created June 20, 2017 07:50
Show Gist options
  • Save tuononh/537a469ae30fd426213007c75881f1a9 to your computer and use it in GitHub Desktop.
Save tuononh/537a469ae30fd426213007c75881f1a9 to your computer and use it in GitHub Desktop.
Another .gitconfig
[user]
# to be customized
email =
name =
[alias]
a = add
aa = add --all
ap = add --patch
amend = commit --amend -CHEAD
b = branch
c = commit -m
co = checkout
cp = cherry-pick
d = !"d() { git diff --patch-with-stat --color $1 $2 | diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): ' || git diff --patch-with-stat --color $1 | diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): ' || git diff --patch-with-stat --color | diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): '; }; git diff-index --quiet HEAD -- || clear; d"
dc = !"d() { git diff --cached --patch-with-stat --color $1 | diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): ' || git diff --cached --patch-with-stat --color | diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): '; }; git diff-index --quiet HEAD -- || clear; d"
f = fetch -p
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
l = log --oneline
m = merge
p = push
rb = rebase
rl = reflog
r = reset
rp = reset --patch
s = status -sb -unormal
v = log --graph --all --format=\"%C(auto)%h%C(reset) %C(auto)%d%C(reset) %s %C(yellow)- %an, %ad%C(reset) %C(dim green)%G?%C(reset)\" --date=relative
vv = log --graph --all --format=\"%C(auto)%h%C(reset) %C(auto)%d%C(reset) %s %C(dim cyan)- %an, %ad%C(reset)%n %C(dim)author :%C(reset) %C(yellow)%aN <%aE>.%C(reset) %C(cyan)%aD%C(reset)%n %C(dim)commiter:%C(reset) %C(yellow)%cN <%cE>.%C(reset) %C(cyan)%cD%C(reset)%n %C(dim)signing :%C(reset) %C(bold green)%G?.%C(reset) %C(yellow)%GS%C(reset) %C(dim cyan)%GK%C(reset)\" --date=relative
[core]
editor = nvim
[credential]
helper = cache --timeout=3600
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[push]
default = nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment