forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig.erb
executable file
·157 lines (141 loc) · 5.68 KB
/
gitconfig.erb
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
[user]
name = Alister Bulman
email = [email protected]
[github]
user = alister
[core]
excludesfile = <%= ENV['HOME'] %>/.gitignore
editor = <%= ENV['EDITOR'] ||= 'joe' %>
autocrlf = input
#filemode = false
attributesfile = <%= ENV['HOME'] %>/.gitattributes
# Treat spaces before tabs, lines that are indented with 8 or more spaces as an error.
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,indent-with-non-tab,trailing-space
[alias]
amend = commit --amend
br = branch
ci = commit
cloner = clone --recursive
co = checkout
df = diff --patch-with-stat --word-diff --find-renames
dfs = diff --staged --patch-with-stat --word-diff --find-renames
dfws = diff --patch-with-stat --find-renames --ws-error-highlight=new,old
head = !"git log -n1"
l = "log --graph --pretty=oneline -n 20 --abbrev-commit"
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%Cred%cn%Cgreen:%cr)%Creset' --abbrev-commit --date=relative"
lgg = "log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%Cred%cn%Cgreen:%cr)%Creset' --abbrev-commit --date=relative"
# Fully commits log with statistic
ll = "log --stat --abbrev-commit"
# Show the log with stats, but without merges
lc = log ORIG_HEAD.. --stat --no-merges
# show the complete commit, with full details
showf = show --format=fuller
simple-tree = log --graph --oneline --branches --simplify-merges --simplify-by-decoration --after='2024-05-23 15:55:00'
pl = pull --rebase
ready = rebase -i @{u}
s = status -s
st = status -sb
unstage = reset HEAD
## parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #"
# Show verbose output about tags, branches or remotes, with summary commit
branches = branch -a -v
remotes = remote -v
tags = tag -l
#up = "!git remote update -p; git merge --ff-only @{u}"
# prefer from https://github.com/tj/git-extras #standup = log ––since yesterday ––author alister
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
ours = "!f() { git checkout --ours $@ && git add \"$@\"; }; f"
theirs = "!f() { git checkout --theirs $@ && git add \"$@\"; }; f"
pushnotes = !sh -c 'git push $1 "refs/notes/*"' -
fetchnotes = !sh -c 'git fetch $1 "refs/notes/*:refs/notes/*"' -
taglist = !"git for-each-ref \
--sort=taggerdate \
--format '%(tag)_,,,_%(taggerdate:raw)_,,,_%(taggername)_,,,_%(subject)' refs/tags \
| awk 'BEGIN { FS = \"_,,,_\" } ; { t=strftime(\"%Y-%m-%d %H:%M\",$2); printf \"%-20s %-18s %-25s %s\\n\", t, $1, $4, $3 }'"
rebc = rebase --continue
rebt = rebase --abort
rebs = rebase --skip
# https://github.com/blueyed/dotfiles/commit/5c4e4be9fc6a56d1ccbc16398ac3fef007d5cc47 "add 'rl' alias for reflog with relative date"
# Also see: [pretty].reflog
rl = reflog --pretty=reflog
## From https://wynnnetherland.com/journal/extending-the-command-line/
# List files known to Git
ls = ls-files
# Get short SHA-1 for object
hash = rev-parse --short HEAD
# See https://difftastic.wilfred.me.uk/git.html#regular-usage
# Difftastic aliases, so `git dlog` is `git log` with difftastic and so on.
dlog = -c diff.external=difft log --ext-diff
dshow = -c diff.external=difft show --format=fuller --ext-diff
#ddf = -c diff.external=difft diff --format=fuller
dft = -c diff.external=difft diff --format=fuller
dfts = -c diff.external=difft diff --format=fuller --staged
[color]
ui = auto
diff = auto
status = auto
branch = auto
[apply]
whitespace = nowarn
[color "diff"]
meta = blue bold
frag = magenta bold
old = red bold
new = green bold
[color "branch"]
current = yellow reverse
local = yellow bold
remote = green bold
plain = red bold
[color "status"]
added = yellow
changed = green bold
untracked = blue bold
[fetch]
# Any git fetch or git pull will automatically prune.
prune = true
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr)%Creset
[push]
default = simple
autoSetupRemote = true
[pull]
rebase = true
[rebase]
autoStash = true
[rerere]
# https://medium.com/@porteneuve/fix-conflicts-only-once-with-git-rerere-7d116b2cec67#.iloud2jeo
enabled = true
[diff]
# https://difftastic.wilfred.me.uk/git.html#regular-usage
tool = difftastic
# Tell git diff to use mnemonic prefixes (index, work tree, commit, object) instead of the standard a and b notation:
mnemonicprefix = true
# Allow git diff to do basic rename and copy detection:
renames = copies
noprefix = true
[init]
defaultBranch = main
# File must exist: https://stackoverflow.com/questions/70435937/git-blame-with-optional-ignorerevsfile
#[blame]
# ignoreRevsFile = .git-blame-ignore-revs
[pretty]
# See: https://github.com/blueyed/dotfiles/commit/5c4e4be9fc6a56d1ccbc16398ac3fef007d5cc47 and alias 'rl', above
# reflog, with relative date:
reflog = %C(auto)%h %<|(17)%gd %<|(30)%C(blue)%cr%C(reset) %s
; reflog = %C(auto)%h %<|(17)%gd %C(blue)%ci%C(reset) %s
# https://difftastic.wilfred.me.uk/git.html#regular-usage
# Se also section: [diff]
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[pager]
difftool = true
[tag]
sort = version:refname
# gpgsign = true