-
Notifications
You must be signed in to change notification settings - Fork 2
/
gitconfig
100 lines (94 loc) · 2.96 KB
/
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
[user]
name = Bob Whitelock
email = [email protected]
[core]
pager = less -FRSX
excludesfile = ~/.gitignore
[push]
default = current
[alias]
absorb = absorb
amend = commit --verbose --amend -C HEAD
amend-and-edit = commit --verbose --amend
touch = "! git reset && git amend"
sed = git sed
fix-conflicts = "! vim +DisablePythonAutoFormat $(git diff --name-only | uniq)"
pull-submodules = submodule foreach git pull
# XXX If working directory clean so no changes to stash, this will
# finish by applying whatever changes were last stashed.
update-submodules = update-submodules
revisions = log --oneline --follow --
history = log -p --follow
add-deleted = ! git rm $(git ls-files --deleted)
tracked-files = ls-tree --full-tree -r HEAD
ls-revisions = ls-revisions
churn = effort
summary = summary
delete-submodule = delete-submodule
delete-remote = push origin --delete
longest = longest
cloc = cloc
cloc-children = cloc-children
own-files = own-files
ctags = !.git/hooks/ctags
review = log -p
delete-branch = delete-branch
; Adapted from https://stackoverflow.com/a/21857717.
cleanup = "!git branch --merged | grep -v '\\*\\|master\\|main\\|develop\\|dev\\|candidate\\|release' | xargs -rn 1 git branch -d"
pop = reset HEAD~
drop = reset --hard HEAD~
just-index = stash save --keep-index
wip = wip
about = git-about
discard-unresolved = discard-unresolved
diff-since=diff-since
changes-since=changes-since
recover=recover
today = changes-since 12hours
run = "!run-command-on-git-revisions"
current-branch = rev-parse --abbrev-ref HEAD
set-upstream = !git branch --set-upstream-to=origin/"$(git current-branch)"
todos-since = todos-since
release-status = release-status
sync-branches = sync-branches
pending-release= "!gl --color=always --first-parent candidate...release | grep -v \"Merge remote-tracking branch 'origin/\""
pending-staging-release= "!gl --color=always --first-parent master...candidate | grep -v \"Merge remote-tracking branch 'origin/\""
# List recently-used branches - from
# http://ses4j.github.io/2020/04/01/git-alias-recent-branches/.
recent = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
[color]
ui = true
[color "diff"]
whitespace = red reverse
[diff]
tool = vimdiff
algorithm = patience
mnemonicprefix = true
colorMoved = zebra
[merge]
ff = false
conflictstyle = diff3
[pull]
ff = only
[init]
templatedir = ~/.git_template
defaultBranch = main
[rerere]
enabled = 1
[interactive]
singleKey = true
[rebase]
autoSquash = true
[branch]
sort = -authordate:iso8601
[advice]
detachedHead = false
[grep]
extendedRegexp = true
lineNumber = true
[hub]
protocol = ssh
[credential "https://github.com"]
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper = !/usr/bin/gh auth git-credential