-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitconfig
128 lines (109 loc) · 3.39 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[user]
name = Stian Eikeland
email = stian@eikeland.se
[github]
user = stianeikeland
token = !security 2>&1 >/dev/null find-generic-password -gs github.token | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'
password = !security 2>&1 >/dev/null find-generic-password -gs github.password | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'
[alias]
co = checkout
l = log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'
ll = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# log key
lk = log --graph --topo-order --abbrev-commit --date=short --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset'
# log with patch generation.
lp = log --patch
# Commit all changes
ca = commit --all
cm = commit -m
cam = commit -am
amend = commit --amend
ap = add --patch
# Status
s = status -s
# Clone a repository including all submodules
c = clone --recursive
# Diff
d = diff
noff = merge --no-ff
word-diff = diff --word-diff
# Merging shortcuts:
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
# Forget that a file was changed (avoid checking in config / passwords /etc)
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
# Legit stuff (from brew):
switch = !legit switch \"$@\"
branches = !legit branches
sprout = !legit sprout \"$@\"
unpublish = !legit unpublish \"$@\"
harvest = !legit harvest \"$@\"
sync = !legit sync \"$@\"
publish = !legit publish \"$@\"
graft = !legit graft \"$@\"
# Pull
pl = pull
plo = pull --rebase origin
plom = pull --rebase origin master
plog = pull --rebase origin gh-pages
plu = pull --rebase upstream
plum = pull --rebase upstream master
plug = pull --rebase upstream gh-pages
pr = pull --rebase
# Push
ps = push
pso = push origin
psom = push origin master
psog = push origin gh-pages
psu = push upstream
psum = push upstream master
psug = push upstream gh-pages
what = whatchanged
# Sync
sync = plu && pso
# Search commits with string
searchcommits = "!f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\""
# This produces output that can be displayed using dotty, for example:
# $ git graphviz HEAD~100..HEAD~60 | dotty /dev/stdin
# $ git graphviz --first-parent master | dotty /dev/stdin
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
[color]
branch = auto
diff = auto
status = auto
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
patience = true
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
tool = p4merge
[core]
autocrlf = false
editor = emacsclient
pager = most
[push]
default = simple
[mergetool]
prompt = false
keepBackup = false
[mergetool "p4merge"]
path = /Users/se/Applications/p4merge.app/Contents/Resources/launchp4merge
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f