-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
56 lines (51 loc) · 1.83 KB
/
dot_gitconfig.tmpl
File metadata and controls
56 lines (51 loc) · 1.83 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
[credential "https://github.com"]
helper =
helper = !{{ lookPath "gh" }} auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !{{ lookPath "gh" }} auth git-credential
[user]
name = {{ .name }}
email = {{ .email }}
[credential]
helper = store
[core]
autocrlf = input
pager = delta
[init]
defaultBranch = main
[pull]
rebase = true
[interactive]
diffFilter = delta --color-only
# Diff tool for git, install with `git-delta`
[delta]
navigate = true
side-by-side = true
line-numbers = true
hyperlinks = true
light = false
[diff]
tool = nvimdiff
[merge]
conflictstyle = zdiff3
tool = nvimdiff
[help]
autocorrect = 20
[alias]
changes = "log -M -L"
fpush = push --force-with-lease
# Push a new branch, with some safety checks in case I forgot I'm not on a branch
do-push-branch = push -u origin HEAD
push-branch = "!master=$(git main-branch); if [ \"$(git symbolic-ref --short HEAD 2>/dev/null)\" = \"$master\" ]; then echo \"$master is not a branch\" 1>&2; exit 1; fi; git do-push-branch"
gpush = "!f() { remote=\"${1:-origin}\"; branch=\"${2:-master}\"; git push \"$remote\" \"HEAD:refs/for/$branch\"; }; f"
gfetch = "!f() { id=\"$1\"; remote=\"${2:-origin}\"; if [ -z \"$id\" ]; then echo 'Usage: git gfetch <change-id> [remote]' >&2; exit 1; fi; suffix=$(printf '%02d' $((id % 100))); ps=$(git ls-remote \"$remote\" \"refs/changes/$suffix/$id/*\" | sed 's|.*/||' | sort -n | tail -1); if [ -z \"$ps\" ]; then echo \"No patchsets found for change $id\" >&2; exit 1; fi; echo \"Fetching change $id patchset $ps\"; git fetch \"$remote\" \"refs/changes/$suffix/$id/$ps\" && git checkout FETCH_HEAD -b \"change-$id\"; }; f"
amend = commit --amend --no-edit
reword = commit --amend --only -v
undo = reset HEAD@{1}
[push]
autoSetupRemote = true
[fetch]
recurseSubmodules = on-demand
prune = true
# vim:ft=gitconfig