-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
78 lines (78 loc) · 2.74 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
78 lines (78 loc) · 2.74 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
[user]
name = {{ .user }}
email = {{ .email }}
[core]
excludesfile = {{ .chezmoi.homeDir }}/.gitignore_global
autocrlf = input
{{- if .isWSL }}
sshCommand = ssh.exe
{{- end }}
{{- if eq .chezmoi.os "darwin" }}
[diff]
tool = bc
[merge]
tool = bc
[mergetool "bc"]
trustExitCode = true
{{- end }}
{{- if .isWSL }}
[diff]
tool = bc
[merge]
tool = bc
[mergetool "bc"]
trustExitCode = true
cmd = '/mnt/c/Program Files/Beyond Compare 4/BComp.exe' \"$(wslpath -aw $LOCAL)\" \"$(wslpath -aw $REMOTE)\" \"$(wslpath -aw $BASE)\" \"$(wslpath -aw $MERGED)\"
[difftool "bc"]
cmd = '/mnt/c/Program Files/Beyond Compare 4/BComp.exe' \"$(wslpath -aw $LOCAL)\" \"$(wslpath -aw $REMOTE)\"
{{- end }}
[init]
defaultBranch = main
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
graph = log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%x20(%ce)%n%x20%s%n"
stat = status -sb
last = log -1 --stat
unstage = reset HEAD --
cached = diff --cached
d = difftool
# `git branch --merged` only asks "is this an ancestor of the target?", so it
# never lists a branch that was rebased or cherry-picked -- the SHAs differ
# even though every line landed. `git cherry` compares by patch-id, catching
# those. Worktree-held branches are listed but never swept.
merged = "!f() { \
target=\"${1:-main}\"; \
git for-each-ref --format='%(refname:short)' refs/heads/ | while read -r b; do \
[ \"$b\" = \"$target\" ] && continue; \
if git worktree list --porcelain | grep -qx \"branch refs/heads/$b\"; then \
git merge-base --is-ancestor \"$b\" \"$target\" 2>/dev/null && printf '%s\\t%s\\n' \"$b\" 'merged (in use by a worktree)'; \
continue; \
fi; \
if git merge-base --is-ancestor \"$b\" \"$target\" 2>/dev/null; then \
printf '%s\\t%s\\n' \"$b\" 'merged'; \
elif [ -z \"$(git cherry \"$target\" \"$b\" 2>/dev/null | grep '^+')\" ]; then \
printf '%s\\t%s\\n' \"$b\" 'rebased/squashed onto target'; \
fi; \
done; }; f"
sweep = "!f() { \
target=\"${1:-main}\"; \
git merged \"$target\" | grep -v 'worktree' | while IFS=\"$(printf '\\t')\" read -r b why; do \
case \"$why\" in \
merged) git branch -d \"$b\" ;; \
*) git branch -D \"$b\" ;; \
esac; \
done; }; f"
[difftool]
prompt = false
{{- if lookPath "gh" }}
[credential "https://github.com"]
helper =
helper = !{{ lookPath "gh" }} auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !{{ lookPath "gh" }} auth git-credential
{{ end }}