-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
127 lines (127 loc) · 4.82 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
125
126
127
# See section ".gitconfig" of:
# https://yadm.io/docs/alternates
[include]
path = .gitconfig.local
[user]
signingkey = 75FA716CC082C83B
[color.diff]
# Represents this part of the diff:
# ```
# @@ -42,6 +42,10 @@ def foo(bar):
# ~~~~~~~~~~~~~
# ```
# Colorize it exactly like in the default output of `colordiff`
func = cyan
# Represents this part of the diff:
# ```
# diff --git a/foo.py b/foo.py
# index 1646df2db..f281b2a2e 100644
# --- a/foo.py
# +++ b/foo.py
# ```
# Unfortunately, as opposed to the `colordiff`, it's not possible to
# colorize separately the `diff` and `index` part (cyan bold in
# `colordiff`), and the `---` and `+++` part (white bold in `colordiff`).
# Let's stick to one color that is subjectively most clear to me
meta = white bold
[delta]
max-line-length = 0
syntax-theme = Visual Studio Dark+
[delta "diff-highlight"]
diff-highlight = true
keep-plus-minus-markers = true
paging = never
[delta "ddiff"]
line-numbers = true
navigate = true
paging = auto
[diff]
tool = vimdiff
colorMoved = default
algorithm = patience
[difftool]
prompt = false
[push]
default = simple
[alias]
diffs = diff --staged
diffm = diff master
ss = status --short --branch
ignored = ! git ss --ignored | grep --color '^!!'
# List all branches (with `remotes/origin/` part removed), then
# sort and deduplicate them by name, then
# choose one using `fzf`, then
# checkout to it
checkoutfzf = ! git checkout $(git branch -a | sed 's@remotes/origin/@@' | sort -u | fzf)
# List all branches other than the ones prefixed by `remotes/origin/`, then
# choose one using `fzf`
# (with a preview showing log of commits that are on that branch, but not on `master`), then
# checkout to it;
# sort order is inherited from `branch.sort`
checkoutfzf2 = ! git checkout $(git branch -a | tr -d ' *' | grep -v '^remotes/origin/' | fzf --preview 'git log --color master..{}' --preview-window 'up')
purr = pull --rebase
lastash = checkout -p stash@{0}
logm = log master..HEAD
# The mnemonic [o]neline [log]
olog = log --oneline
ologm = log --oneline master..HEAD
rs = restore --staged
pushu = ! git push -u origin $(git branch --show-current)
pusht = push --tags
# The mnemonic [b]etter [diff]
bdiff = ! git diff --color=always | delta --features=diff-highlight | less -FR
bdiffs = ! git diffs --color=always | delta --features=diff-highlight | less -FR
bdiffm = ! git diffm --color=always | delta --features=diff-highlight | less -FR
# The mnemonic [d]elta [diff]
ddiff = ! git diff --color=always | delta --features=ddiff
ddiffs = ! git diffs --color=always | delta --features=ddiff
ddiffm = ! git diffm --color=always | delta --features=ddiff
# Add all changed tracked files to the index while being verbose about it
# to allow instant verification of what exactly was added.
# The alias `ada` comes from [ad]d [a]ll, while also being the tribute
# to Ada Lovelace
ada = add -vu
comane = commit --amend --no-edit
cm = checkout master
changelog-squash = log --pretty='* %B'
cp = cherry-pick
mergeff = merge --ff-only
logss = log --show-signature
logme = ! git log --author=$(git config user.email)
comnogpg = commit --no-gpg-sign
# Outputs the full commit hash of the most recent commit, e.g.
# `git hash | pbcopy` will copy the most recent commit hash into the system
# clipboard
hash = log -1 --pretty=tformat:%H
rc = rebase --continue
# Rebase interactively all commits on the current branch that are ahead of
# `master` branch
rebasim = ! git rebase -i --autosquash --rebase-merges "HEAD~$(git ologm | wc -l | tr -d ' ')"
# Run pre-commit hooks after each commit during the rebase
prebase = rebase -x 'pre-commit run --from-ref HEAD~ --to-ref HEAD'
# Rebase interactively all commits on the current branch that are ahead of
# `master` branch and run pre-commit hooks after each commit during the rebase
prebasim = ! git prebase -i --autosquash --rebase-merges "HEAD~$(git ologm | wc -l | tr -d ' ')"
# For fun, borrowed from: https://github.com/maciejkorsan/podlaskigit
# Relies on the fact that there's no other command or alias starting with
# `ak`, therefore `ak<TAB>` is enough to run this alias
akomutopotrzebne = reset HEAD --hard
[merge]
tool = diffconflicts
prompt = false
[mergetool]
keepBackup = false
[mergetool "diffconflicts"]
cmd = vim -c DiffConflicts \"$MERGED\" \"$BASE\" \"$LOCAL\" \"$REMOTE\"
trustExitCode = true
[pull]
rebase = false
[commit]
gpgSign = true
[tag]
gpgSign = true
[log]
date = format-local:%a %F %R %Z
[branch]
# Order by the most recent commit
sort = -committerdate