-
Notifications
You must be signed in to change notification settings - Fork 3
/
dot.gitconfig
115 lines (115 loc) · 4.17 KB
/
dot.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
[user]
name = Shogo Iwano
email = shiwano@gmail.com
[github]
user = shiwano
token = !security 2>&1 >/dev/null find-generic-password -gs \"GitHub API Token\" | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'
[core]
excludesfile = ~/.gitignore
autocrlf = false
editor = nvim
pager = delta
quotepath = false
[color]
ui = auto
[alias]
gommit = commit
re = !git restore -s $(git upstream-branch)
sw = switch
swd = switch --detach
ci = commit
cim = commit -m
cia = commit --amend -C HEAD
a = add -A
au = add -u
ap = add -p
s = status
up = pull --rebase
diff = diff --color
di = diff --color
dica = diff --color --cached
dist = diff --color --staged
diw = diff --color --word-diff
di-csv = diff --color --word-diff-regex="[^[:blank:],]"
dist-csv = diff --staged --color --word-diff-regex="[^[:blank:],]"
diff-branch = !git diff $(git main-branch) $(git current-branch)
dm = diff-main
diff-main = !git diff $(git main-branch) $(git current-branch)
mt = mergetool
merge-prefer-current-branch = merge -X ours
merge-prefer-target-branch = merge -X theirs
checkout-prefer-current-branch = checkout --ours
checkout-prefer-target-branch = checkout --theirs
topic = !git switch $(git main-branch) -c
topic-develop = switch origin/develop -c
topic-production = switch origin/production -c
topic-dev = switch origin/dev -c
main-branch = rev-parse --abbrev-ref origin/HEAD
current-branch = symbolic-ref --short HEAD
current-remote-branch = "!sh -c 'echo `git upstream-remote`/`git current-branch`'"
upstream-branch = "!sh -c 'git branch -vv --list `git current-branch` --format=\"%(upstream:short)\"'"
upstream-remote = "!sh -c 'git upstream-branch | cut -d / -f 1'"
la = log --graph --all --color --pretty='%x09%h %cn%x09%s %Cred%d%Creset'
log-all = log --graph --all --color --pretty='%x09%h %cn%x09%s %Cred%d%Creset'
lg = log --graph --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn %Creset%s'
log-graph = log --graph --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn %Creset%s'
ls = log --stat --summary --color
log-stat = log --stat --summary --color
lp = log --patch --color
log-patch = log --patch --color
lo = log --color --oneline
log-oneline = log --color --oneline
log-shallow-since = log --date=raw
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
ignored = !git ls-files -v | grep "^[a-z]"
unstage = reset HEAD
us = reset HEAD
back = reset HEAD~
stash-ls = stash list --stat
rank = shortlog -s -n -e
sed = "!sh -c 'cd ${GIT_PREFIX:-.} && git ls-files \"$0\" | xargs sed -i -e \"$1\"'"
sed-help = "!echo \"git sed '**/*.go' 's/foo/bar/g'\""
rename = "!sh -c 'git branch -m `git current-branch` $0'"
upstream = "!sh -c 'git branch --set-upstream-to=$0 `git current-branch`'"
mru = for-each-ref --format='%(refname:short) (%(authordate:relative))' --sort=committerdate refs/heads/
reset-remote = "!sh -c 'git fetch && git reset --hard `git current-remote-branch`'"
upup = "!sh -c 'git fetch && git rebase `git current-remote-branch`'"
go-version = "!sh -c 'TZ=UTC git --no-pager show --quiet --abbrev=12 --date=\"format-local:%Y%m%d%H%M%S\" --format=\"v0.0.0-%cd-%h\"'"
log-shallow-since = log --date=raw
empty-commit = commit --allow-empty
[merge]
tool = nvimdiff
conflictstyle = zdiff3
[diff]
colorMoved = default
[difftool "nvimdiff"]
cmd = "nvim -R -d -c \"wincmd l\" -d \"$LOCAL\" \"$REMOTE\""
[mergetool "nvimdiff"]
cmd = "nvim -d -c \"4wincmd w | wincmd J\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\""
[http]
postBuffer = 524288000
[push]
default = current
[fetch]
prune = true
[ghq]
root = ~/code/src
[url "git@github.com:"]
insteadOf = https://github.com/
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[init]
defaultBranch = main
[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)
line-numbers = true
syntax-theme = base16-256
[mergetool]
keepBackup = false