-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdot_gitconfig-chezmoi.tmpl
More file actions
127 lines (101 loc) · 3.59 KB
/
dot_gitconfig-chezmoi.tmpl
File metadata and controls
127 lines (101 loc) · 3.59 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
{{ if not .git_work -}}
[user]
name = {{ .name }}
email = {{ .email }}
{{ end -}}
[alias]
cam = commit -am
fpush = push --force-with-lease
dc = diff --cached
# Grabbed a few of these from github.com/jessfraz/dotfiles
# Short clean status
s = status -s
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
lg = log --color --decorate --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an (%G?)>%Creset' --abbrev-commit
# Working with stacks
default-branch = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
merge-base-origin = "!f() { git merge-base ${1-HEAD} origin/$(git default-branch); };f "
stack = "!f() { BRANCH=${1-HEAD}; MERGE_BASE=$(git merge-base-origin $BRANCH); git log --decorate-refs=refs/heads --simplify-by-decoration --pretty=format:\\\"%(decorate:prefix=,suffix=,tag=,separator=%n)\\\" $MERGE_BASE..$BRANCH; };f "
push-stack = "!f() { BRANCH=${1-HEAD}; git stack $BRANCH | xargs -I {} git push --force-with-lease origin {}; };f "
rebase-origin = "!f() { git rebase ${1-HEAD} origin/$(git default-branch); };f "
absorb = !c:/tools/git-absorb/git-absorb.exe
# Fetch, rebase default branch, prune merged branches (gh poi), return to original branch
sync = "!f() { cb=$(git branch --show-current); git fetch --all --prune --tags && git checkout $(git default-branch) && git rebase && gh poi && if git show-ref --verify --quiet refs/heads/\"$cb\"; then git checkout \"$cb\"; else echo \"Branch '$cb' was pruned; staying on $(git default-branch)\"; fi; };f"
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[push]
default = current
autoSetupRemote = true
[pull]
rebase = true
[core]
editor = nvim
pager = delta
hooksPath = ~/.config/git/hooks
excludesfile = ~/.gitignore_global
{{ if eq .chezmoi.os "windows" -}}
sshCommand = \"C:/Windows/System32/OpenSSH/ssh.exe\"
{{ end -}}
[delta]
true-color = "always"
features = unobtrusive-line-numbers darkly
syntax-theme = OneHalfDark
hyperlinks = true
hyperlinks-file-link-format = "vscode://file/{path}:{line}"
navigate = true
[delta "unobtrusive-line-numbers"]
line-numbers = true
line-numbers-minus-style = "#ff38b6"
line-numbers-zero-style = "#cccccc"
line-numbers-plus-style = "#00e0c2"
line-numbers-left-format = "{nm:>4} ."
line-numbers-right-format = "{np:>4} "
line-numbers-left-style = "#e3ab02"
line-numbers-right-style = white
[delta "decorations"]
commit-decoration-style = yellow box ul
file-style = yellow ul
file-decoration-style = white box
hunk-header-decoration-style = yellow box
[delta "darkly"]
commit-decoration-style = box ul "#34fd50"
dark = true
#file-decoration-style = none
#file-style = omit
hunk-header-decoration-style = "#00b494" ul
hunk-header-line-number-style = "#03a4ff"
hunk-header-style = line-number syntax
plus-emph-style = syntax "#066a57"
plus-style = syntax "#03372d"
minus-emph-style = normal "#a73f74"
minus-style = normal "#5a223e"
[interactive]
diffFilter = delta --color-only
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait --merge $REMOTE $LOCAL $BASE $MERGED
[diff]
tool = vscode
colorMoved = default
[difftool "vscode"]
cmd = code-insiders --wait --diff $REMOTE $LOCAL
[init]
defaultBranch = main
[branch]
sort = -committerdate
[advice]
skippedCherryPicks = false
[rerere]
enabled = true
[rebase]
updateRefs = true
[help]
# Automatically correct and execute mistyped commands
autocorrect = 1
[commit]
template = ~/.gitmessage.txt