-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
191 lines (143 loc) · 5.05 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
[user]
name = Cenk Altı
email = cenkalti@gmail.com
signingKey = 45173BCEAB1B618F917DFFC12DB2EA6FD1BF1761
[commit]
gpgsign = true
[alias]
# List defined aliases
ls = "!git config --get-regexp alias\\. | sed 's/^......//' | sed 's/ / /'"
st = status --short --branch
stu = status -uno
# Commit with message
ci = commit -m
# Commit with empty message
ce = "!f() { git commit --allow-empty --allow-empty-message -m \"$1\"; }; f"
# Edit last commit message
edit = commit --amend
# Amend the changes into previos commit
amend = commit --amend --date="now" -C HEAD
# Dangerous commands
#
pr = pull --rebase
prp = "!git pull --rebase && git push"
pp = "!git pull --no-edit && git push"
ss = "!git stash && git pull --rebase --no-edit && git push && git stash pop"
co = checkout
cp = cherry-pick
br = branch
wc = whatchanged
up = branch --set-upstream-to # ... origin/<master> <branch>
tr = branch -vv
df = diff
dfs = diff --stat
dfc = diff --cached
dft = difftool
today = log --since="6am"
contributors = shortlog -s -n
# Show the fetched commits
lc = log ORIG_HEAD.. --stat --no-merges
# Nice history views
lol = log --graph --decorate --oneline --abbrev-commit
lola = log --graph --decorate --oneline --abbrev-commit --all
dag = "log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order"
# Show commits between two refs. Pass argument like master...feature
lr = log --graph --oneline --left-right --cherry-pick
# Show commits between master and the current branch
lrm = "!git log --graph --oneline --left-right --cherry-pick master...`git rev-parse HEAD`"
# Show commits in last week
lw = "!git log --since='8 days ago' --author=cenkalti --pretty='format:%cd %Cblue%h%Creset %s' --date='format:%a %d %b' --reverse"
# Show only my commits
me = "!git log --author=cenkalti --pretty='format:%cd %Cblue%h%Creset %s' --date='format:%a %d %b'"
xxx = reset --hard
prev = reset HEAD^
# Exclude files from git temporarily
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
# Delete local branches that are merged into master
dm = "!git branch --merged | grep -v '*' | grep -v 'master$' | xargs -n 1 git branch -d"
# Delete local brach
dl = branch -D
# Delete remote branch
dr = push origin --delete
# Delete tag from local and remote
dt = "!git tag -d $1 && git push --delete origin"
# Add only untracked files
au = "!git ls-files -o --exclude-standard -z | xargs -0 git add"
# Construct a commit message for use with rebase --autosquash
fixup = "!git log -n 50 --pretty=format:'%h %s' --no-merges | fzf | cut -c -7 | xargs -o git commit --fixup"
[color]
ui = true
pager = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
commit = yellow bold
[color "status"]
added = green
changed = yellow
untracked = cyan
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[core]
editor = nvim
autocrlf = false
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
light = false # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
[pager]
difftool = true
[clean]
requireForce = false
[merge]
summary = true
conflictstyle = diff3
[push]
default = current
followTags = true
[diff]
algorithm = patience
compactionHeuristic = true
tool = difftastic
colorMoved = default
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[credential]
helper = osxkeychain
[github]
user = cenk
[ghi]
token = !security find-internet-password -a cenk -s github.com -l 'ghi token' -w
[fetch]
prune = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
ff = only
[rebase]
autosquash = true
; [url "ssh://git@github.com/"]
; insteadOf = https://github.com/
[include]
path = ~/.local.gitconfig
[init]
defaultBranch = main