-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_gitconfig.tmpl
174 lines (155 loc) · 3.9 KB
/
dot_gitconfig.tmpl
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
[user]
name = {{ .name }}
email = {{ .email }}
signingkey = {{ .signingkey }}
[commit]
gpgsign = true
[alias]
# utility to get the mainline branch
main-branch = !"git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4"
# Add
aa = add --all
# Commit
ci = commit -m
ce = commit -e
cia = commit -a -m
doh = commit --amend --no-edit
oops = !"git commit --amend --no-edit && git push origin +HEAD"
# Checkout
co = checkout
cb = checkout -b
com = !"git checkout $(git main-branch)"
# Diff
d = !"git diff --no-color | tig"
dc = !"git diff --cached --no-color | tig"
di = difftool
dic = difftool --cached
dh1 = !"git diff HEAD~1 --no-color | tig"
# Merge
m = merge --no-ff
me = !"nvim -c 'DiffviewOpen'"
mff = merge --ff
# Push
pp = pull --prune
pre = pull --rebase
# Fetch
fu = fetch upstream
# Pull
p = push
poh = push origin HEAD
pof = push origin +HEAD
pom = !"git push origin $(git main-branch)"
puh = push upstream HEAD
# tig shims
l = !tig
r = !tig -20
h = !tig show HEAD
# Logging/Status
lo = log --graph --pretty=format:'%C(bold red)%h%Creset%C(yellow)%d%Creset %s %Cgreen(%C(magenta)%an%Creset%Cgreen, %cr)%Creset' --abbrev-commit --date=relative
la = !git l --all
ra = !git r --all
# Resetting
undo-last = reset --soft HEAD~1
# Stashing and popping
s = stash
sp = stash pop
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
# Grabbing SHA of latest commit (osx only)
sha = !"echo 'Copying HEAD SHA...' && git rev-parse HEAD | tr -d '\n' | pbcopy"
# For the lolz
yolo = !git reset --hard HEAD^
in = incoming
out = outgoing
# Find FIXME, TODO, etc
# Taken from @pengwynn
n = !"git ls-files | xargs notes | awk -F: '{ print $1,$2; print $3,$4; print $5}' | grcat conf.notes"
# GitHub Workflow stuff
f = workflow -p attamusc/feat
bug = workflow -p attamusc/fix
hotfix = workflow -p attamusc/hotfix
release = workflow -p attamusc/release
# Helper to fork a repo after cloning it locally
own = !"hub fork && git remote rename origin upstream && git remote rename Attamusc origin"
[core]
editor = "nvim"
excludesfile = ~/.gitignore
pager= delta
[interactive]
diffFilter = delta --color-only
[github]
user = Attamusc
[delta]
features = side-by-side
[credential]
helper =
helper = /usr/local/bin/git-credential-manager
[color]
ui = auto
[color "branch"]
current = magenta
local = blue
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green
changed = cyan
untracked = red
[push]
default = simple
[remote]
pushDefault = origin
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path "$MERGED" -- "$LOCAL" "$REMOTE"
[difftool "smerge"]
cmd = smerge "$BASE"
[diff]
tool = smerge
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output "$MERGED" --base "$BASE" -- "$LOCAL" --snapshot "$REMOTE" --snapshot
trustExitCode = true
[mergetool "smerge"]
cmd = smerge mergetool "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"
trustExitCode = true
[mergetool]
prompt = false
[merge]
tool = smerge
[tig "color"]
cursor = black green bold
[flow "prefix"]
feature = feature
hotfix = hotfix
refactor = refactor
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[url "https://"]
insteadOf = git://
[http]
postBuffer = 524288000
[pull]
rebase = true
[init]
defaultBranch = main
[credential "https://dev.azure.com"]
useHttpPath = true
[credential "https://ghe.io"]
provider = github
[ghq]
root = ~/projects
[gpg]
format = ssh
[gpg "ssh"]
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"