-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
186 lines (167 loc) · 5.05 KB
/
.gitconfig
File metadata and controls
186 lines (167 loc) · 5.05 KB
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
[user]
email = frederikgalle@fastmail.fm
name = Frederik Galle
[includeIf "gitdir:~/src/"]
path = ~/src/.gitconfig
[core]
editor = /opt/homebrew/bin/nvim
pager = delta
quotepath = false
excludesfile = ~/.gitignore
autocrlf = input
# 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
attributesfile = ~/.gitattributes
hooksPath = /Users/fgalle/.git_hooks
[color "branch"]
current = green
local = yellow
remote = cyan
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
new = green
commit = yellow
whitespace = normal red
[color "status"]
added = green
changed = yellow
unchanged = cyan
untracked = cyan
nobranch = red
[color "interactive"]
header = yellow
help = red
prompt = blue
[alias]
git = !exec git
co = checkout
# Add to staging area
a = add
up = add --update --patch
ap = add --patch
patch = add --patch
# Commit
c = commit --verbose
cm = commit -m
amend = commit --amend --verbose
# Unstage the changes to some files
unstage = reset HEAD --
# Undo the last commit
undo = reset --soft "HEAD^"
# Short and verbose statuses
s = "!f() { printf '\\n' && cd -- ${GIT_PREFIX:-.}; git status --short $@ && printf '\\n'; }; f"
sv = status
watch = "!while :; do clear; git status --short; git --no-pager diff --shortstat; sleep 2; done"
watchh = "!while :; do clear; git log; sleep 2; done"
# Overview of branches
b = branch
bl = branch --verbose
bla = branch --verbose --all
# Diffs
sd = diff --staged
d = diff
dt = difftool --no-symlinks --dir-diff
sdiff = "!git submodule foreach 'git diff'"
# Show list of changes between two commits
changes="!f() { git log --pretty=format:'* %s' $1..$2; }; f"
# Overview of history
sl = log --oneline --decorate -20
sla = log --oneline --decorate --graph --all -20
slp = log --oneline --decorate
slap = log --oneline --decorate --graph --all
# Show files that are being ignored due to git update-index --assume-unchanged
ignored = !git ls-files -v `git rev-parse --show-toplevel` | grep "^[a-z]"
# Remove deleted files
r = !git ls-files -z --deleted | xargs -r -0 git rm
# Exclude file locally
exclude = !sh -c 'echo "$1" >> .git/info/exclude' -
# Prune deleted branches
prune = fetch --prune
# Clean up branches that have been deleted on the remote
clean-gone = "!git branch -vv | rg '\\[.*gone.*\\]' | sed 's/^..//' | cut -d' ' -f1 | xargs -r git branch -D"
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -vv
remotes = remote -v
# list files which have changed since REVIEW_BASE
# (REVIEW_BASE defaults to 'master' in my zshrc)
files = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\")
# Same as above, but with a diff stat instead of just names
# (better for interactive use)
stat = !git diff --stat $(git merge-base HEAD \"$REVIEW_BASE\")
# Open all files changed since REVIEW_BASE in Vim tabs
# Then, run fugitive's :Gdiff in each tab, and finally
# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
review = !nvim -p $(git files) +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
# Same as the above, except specify names of files as arguments,
# instead of opening all files:
# git reviewone foo.js bar.js
reviewone = !nvim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
gmm="!git checkout master && git pull && git checkout - && git merge master"
# list aliases
alias = "!git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort | column -t -s $'\\t'"
[push]
autoSetupRemote = true
default = current
followTags = true
recurseSubmodules = check
[fetch]
prune = true
[help]
autocorrect = 1
[diff "bin"]
# Use `hexdump` to diff binary files
textconv = hexdump -v -C
[diff]
algorithm = patience
mnemonicprefix = true
renames = copies
submodule=log
tool = kitty
[difftool]
prompt = false
trustExitCode = true
[difftool "kitty"]
cmd = kitty +kitten diff $LOCAL $REMOTE
[log]
date = "auto:human"
[rebase]
autosquash = true
autostash = true
[merge]
tool = vimdiff
conflictstyle = zdiff3
autostash = true
[mergetool]
keepBackup = false
[status]
submodulesummary = -1 # unlimited
[hooks "confirm"]
match = TODO
[commit]
template = ~/.gitmessage
[url "github.com:"]
insteadOf = github:
[url "git@github.com:"]
insteadOf = https://github.com
[interactive]
diffFilter = delta --color-only
[delta]
tabs = 4
navigate = true
hyperlinks = true
hyperlinks-file-link-format = "file://{path}#{line}"
features = decorations
whitespace-error-style = 22 reverse
[delta "decorations"]
commit-decoration-style = bold yellow box
file-style = bold yellow ul
file-decoration-style = none
[pull]
ff = only
[advice]
forceDeleteBranch = false