-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitconfig
191 lines (142 loc) · 4.95 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
[alias]
# List aliases
aliases = config --get-regexp alias
# Staging & commiting
a = add
aa = add .
amend = commit --amend --no-edit
c = commit
discard = checkout --
discard-all = checkout -- *
unstage = reset HEAD
uncommit = reset --soft HEAD^
uncommit-hard = reset --hard HEAD^ # also undo's changes to unstaged files
revert-file = "!f() { git checkout $1 -- $2; }; f"
rekt = "!f() { git aa && git commit -m \"Commit\" && git update; }; f"
# Branching
co = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" # checkout or create if non-existent
ch = checkout
cu = "!f() { git checkout $1 && git pull; }; f" # checkout and fetch remote changes
branch-rm = branch -d
branch-mv = branch -m
branch-cleanup = remote update --prune
branch-rm-remote = "!f() { git branch -d $1; git push origin --delete $1; }; f"
branch-mv-rem = "!f() { git branch -m $1 $2; git push origin --delete $1; git push --set-upstream origin $2: }; f"
branch-prune-remote = fetch origin --prune
which = !git branch | grep -i
lucky = !sh -c 'git checkout $(git which $1 -m1)' -
get-current-branch = rev-parse --abbrev-ref HEAD
update = push origin HEAD
# Gitflow
ft = "!f() { git checkout -b feature/\"$1\" 2> /dev/null || git checkout feature/\"$1\"; }; f"
hf = "!f() { git checkout -b hotfix/\"$1\" 2> /dev/null || git checkout hotfix/\"$1\"; }; f"
rel = "!f() { git checkout -b release/\"$1\" 2> /dev/null || git checkout release/\"$1\"; }; f"
dep = "!f() { git checkout -b dependencies/\"$1\" 2> /dev/null || git checkout dependencies/\"$1\"; }; f"
# Remotes
ghc = "!f() { git clone https://github.com/\"$1\"; }; f"
pl = pull
ps = push
publish = !git push -u origin $(git get-current-branch)
ro = remote add origin
f = fetch origin
open = "!f() { open $(git remote get-url origin); }; f"
# Controlling
d = diff
filemerge = difftool -t opendiff -y
l = log
log-short = log --pretty=oneline --abbrev-commit --graph --decorate
log-short-no-merges = log-short --no-merge --first-parent
log-search = log -S
s = status
ss = status -s
stats = shortlog -sn
today = diff --shortstat "@{0 day ago}"
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
br = branch -a -v
remotes = remote -v
# Temporarily disable GPG signing for use of Github Desktop.app
nogpg = config --global commit.gpgsign false
gpg = config --global commit.gpgsign true
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
# Use custom `.gitignore` and `.gitattributes`
excludesfile = /Users/thibaultmaekelbergh/.config/.gitignore
attributesfile = ~/.gitattributes
# Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# Use diff-so-fancy as the default diff viewer
pager = diff-so-fancy | less --tabs=4 -RFX
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
# Detect copies as well as renames
renames = copies
[help]
# Automatically correct and execute mistyped commands
autocorrect = 1
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
[push]
# Push only the current branch instead of all
default = current
# URL shorthands
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git lfs clean %f
smudge = git lfs smudge %f
required = true
[credential]
helper = osxkeychain
[include]
# Include extra git functions outside of $HOME/.gitconfig
path = /Users/thibaultmaekelbergh/.ext_aliases/git-conf-extends/gpg
path = /Users/thibaultmaekelbergh/.ext_aliases/git-conf-extends/git-functions
[user]
name = Thibault Maekelbergh
email = thibault.maekelbergh@icloud.com
signingkey = 0085F9B9762D25E9
gpgsign = true