Skip to content

Instantly share code, notes, and snippets.

@yutarot
Last active March 29, 2018 12:39
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 yutarot/b5e341e8f8018bd5ea66278c6269012d to your computer and use it in GitHub Desktop.
Save yutarot/b5e341e8f8018bd5ea66278c6269012d to your computer and use it in GitHub Desktop.
for Mac.
[user]
#name =
#email =
#signingkey =
[core]
#excludesfile = /Users/{userName}/.gitignore_global
[mergetool "sourcetree"]
cmd = /usr/local/bin/meld $LOCAL $MERGED $REMOTE
trustExitCode = true
[difftool "sourcetree"]
cmd = /usr/local/bin/meld $LOCAL $REMOTE
path =
[color]
status = auto
diff = auto
branch = auto
interactive = auto
grep = auto
ui = auto
[alias]
########## basic commands ###########
ad = add
br = branch
cm = commit
co = checkout
mg = merge
pl = pull
ps = push
st = status
########## custom commands ##########
aa = add .
# git alias || git alias [alias command]
alias = !"f(){ if test -z $1; then loop=; for k in `git config --get-regexp ^alias\\. | sort | gsed -e 's/^alias\\.\\(\\S*\\).*/\\1/g'`; do printf $k; loop=${loop}1; if test ${#loop} -lt 5; then printf '\t'; else echo; loop=; fi; done; echo; exit; fi; git config --list | grep ^alias\\.$1= | gsed -e s/^alias\\.//; exit; }; f"
d1 = diff HEAD~ # diff with 1 previous commit from the HEAD
d2 = diff HEAD~~ # diff with 2 previous commit from the HEAD
d3 = diff HEAD~~~ # diff with 3 previous commit from the HEAD
d4 = diff HEAD~~~~ # diff with 4 previous commit from the HEAD
d5 = diff HEAD~~~~~ # diff with 5 previous commit from the HEAD
d6 = diff HEAD~~~~~~ # diff with 6 previous commit from the HEAD
d7 = diff HEAD~~~~~~~ # diff with 7 previous commit from the HEAD
d8 = diff HEAD~~~~~~~~ # diff with 8 previous commit from the HEAD
d9 = diff HEAD~~~~~~~~~ # diff with 9 previous commit from the HEAD
df = diff --color-words --word-diff-regex='\\w+|[^[:space:]]' #diff
dl = branch -D # delete
lg = log --graph --name-status --decorate # log
lgg = log --graph --all --pretty=format:'%C(yellow)%h%Creset %C(magenta)%cd%Creset %C(cyan)%cn%Creset %s %Cred%d%Creset' # log graph
rh = reset --hard --
[filter "lfs"]
clean = git-lfs clean -- %f
process = git-lfs filter-process
required = true
smudge = git-lfs smudge -- %f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment