-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
80 lines (68 loc) · 2.5 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
[alias]
# add
a = add # add
chunkyadd = add --patch # stage commits chunk by chunk
# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
snapshots = !git stash list --grep snapshot
# via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
recent-branches = !git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='%(refname:short)'
# merge
mg = merge --no-ff
# commit
c = commit -m # commit with message
ca = commit -am # commit all with message
ci = commit # commit
cmv = commit -v
# checkout
co = checkout # checkout
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
# diff
d = diff # diff unstaged changes
dc = diff --cached # diff staged changes
last = diff HEAD^ # diff last committed change
# log
l = log --graph --date=short
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lds = log --pretty=format:'%C(yellow)%h %ad%Cred%d %Creset%s%Cblue [%cn]' --decorate --date=short
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
# status
s = status # status
dft = difftool
[format]
pretty = format:%C(blue)%aI%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an %C(green)<%ae>%C(magenta)]%Creset
[color]
ui = 1
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
new = green
[core]
autocrlf = input
quotepath = false
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[diff]
tool = difftastic
[difftool "vimdiff"]
cmd = /usr/bin/env vimdiff \"$LOCAL\" \"$REMOTE\"
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[difftool]
prompt = false
[color]
diff = auto
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[pager]
difftool = true