-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
80 lines (73 loc) · 3.29 KB
/
.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[color]
ui = auto
[core]
autocrlf = false
editor = emacs
quotepath = false
excludesfile = ~/.gitignore_global
[merge]
tool = opendiff
[alias]
lg = log --graph --pretty=oneline --abbrev-commit --decorate
tagcommit = !sh -c 'git rev-list $0 | head -n 1'
[mergetool "diffmerge"]
cmd = diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
trustExitCode = false
[push]
default = simple
[pull]
default = simple
[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
# https://git.wiki.kernel.org/index.php/Aliases
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
dc = diff --cached
co = checkout
df = diff
dc = diff --cached
lgp = log -p
lg = log
who = shortlog -s --
changes=diff --name-status -r
diffstat=diff --stat
ds = diff --stat
# To see what new commits have been created by the last command (typically after a "git pull") :
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
lggl = log --graph --pretty=format:'%Cred%H%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lgg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# If you want to be able to say git lc to list all new commits after you fetched, with stats, but excluding merges, add this alias:
lc = log ORIG_HEAD.. --stat --no-merges
# Now that you know all about aliases, it might be handy to define some, using an alias:
alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -"
# Going further, to get a list of your defined aliases:
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
lgs = log --stat
dcs = diff --cached --stat
dfw = diff --word-diff
dfc = diff --word-diff-regex=.
dcc = diff --cached --word-diff-regex=.
dcw = diff --cached --word-diff
lgc = log -p --word-diff-regex=.
lgw = log -p --word-diff
sh = show HEAD
# if you use less as default pager just type -S while viewing the diff to reenable wrapping in less
# http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
brecent = for-each-ref --count=20 --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(author)%09%09%(refname:short)'
rbrecent = for-each-ref --count=20 --sort=-committerdate refs/remotes/ --format='%(committerdate:short) %(author)%09%09%(refname:short)'
# http://blog.kfish.org/2010/04/git-lola.html
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
p = pull --ff-only
mt = mergetool --tool=opendiff
tracking = rev-parse --abbrev-ref --symbolic-full-name @{u}