forked from damncabbage/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
124 lines (99 loc) · 4.27 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[user]
name = Robin Howard
email = robin@rhoward.id.au
[core]
excludesfile = ~/.gitignore_global
editor = /usr/bin/env vim
pager = delta # https://github.com/dandavison/delta
[commit]
verbose = true # Include the commit diff in the chunk of stuff git preloads into the editor
[diff]
colorMoved = plain # Show moved blocks in a different colour to added+removed blocks
colorWords = true # Word diffs
[delta]
syntax-theme = "fairyfloss"
#minus-style = normal "#572739"
#minus-emph-style = normal "#9b2739"
#minus-empty-line-marker-style = normal "#5f3951"
#plus-style = syntax "#2D5C18"
#plus-emph-style = syntax "#2D7C18"
#plus-empty-line-marker-style = normal "#395f51"
minus-style = normal "#814A62"
minus-emph-style = normal "#b42840"
minus-empty-line-marker-style = normal "#814A62"
plus-style = syntax "#0A6D00"
plus-emph-style = syntax "#0A8E1E"
plus-empty-line-marker-style = normal "#395f51"
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
hunk-header-decoration-style = yellow box
[difftool "vimdiff"]
cmd = vimdiff -c ':colorscheme ron' $LOCAL $REMOTE
[log]
decorate = full # Show if a commit is the head of remote or local branch
[merge]
renameLimit = 10000 # The number of files to consider when figuring out when files have been renamed.
conflictstyle = diff3 # A three-part diff: shows ours, original, and theirs; see https://stackoverflow.com/q/27417656
[pull]
ff = only # No accidental merges when 'git pull'-ing
[push]
default = simple # 'upstream' for same origin, 'current' otherwise; includes safety checks.
followTags = true # Also push tags associated with commits being pushed; disable with 'git push --no-follow-tags'
[stash]
showPatch = true # 'git show stash' shows the diff, like 'git show stash@{0}'
[status]
submoduleSummary = true
[sequence]
#editor = interactive-rebase-tool # Still unsure about this one; a bit _too_ different from both tig and vim.
[rebase]
autoStash = true
autoSquash = true
[alias]
cf = fixup-select
f = fetch -p
co = checkout
cop = branch-select
bs = branch-select
copr = "!f() { git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1; }; f" # Running 'git copr 1234' checks out PR #1234
nb = !"git checkout -b"
nbo = "!f() { set -u; git fetch origin && git checkout -b \"$1\" \"origin/$(git trunk)\" && git pu; }; f"
pc = push -u origin HEAD
pcf = push origin HEAD --force-with-lease
pu = push -u origin HEAD
puf = push origin HEAD --force-with-lease
prom = "!git pull --rebase origin \"$(git trunk)\""
# TODO: Remove...?
sync = "!f() { \
if [ -z \"$1\" ]; then \
echo 'Usage: git sync [remote] my-branch-to-sync'; \
exit 1; \
fi; \
local remote branch; \
if [ -z \"$2\" ]; then \
remote=origin; branch=$1; \
else \
remote=$1; branch=$2; \
fi; \
git fetch \"$remote\" \"${branch}:${branch}\"; \
}; f"
s = status
d = difftool -t vimdiff
csvdiff = diff --color-words --ignore-space-at-eol --word-diff-regex="[^[:space:],]+"
lgflat = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%cr)%C(reset) %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lgtree = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%cD%C(reset) %C(bold green)(%cr)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)' --abbrev-commit
lg = !"git lgflat"
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
prune-all = !git remote | xargs -n 1 git remote prune
trunk = "!f() { \
local trunk=\"$(git rev-parse --show-toplevel)/.gittrunk\"; \
if [ -f \"$trunk\" ]; then \
cat \"$trunk\"; \
else \
echo 'master'; \
fi; \
}; f"
git = "!git" # Allows 'git git diff' et al to work, when Rob is being scatter-brained and types+pastes git.
[include]
path = "~/.gitrc.d/local"