-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_gitconfig
131 lines (127 loc) · 4.55 KB
/
dot_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
128
129
130
131
[color]
ui = true
# We use always here instead of auto because otherwise
# we don't get any coloring with Ggrep in vim.
# DISABLED: breaks `git jump grep`
#grep = always
[color "grep"]
linenumber = green
match = red bold
filename = magenta
[merge]
conflictstyle=zdiff3
[user]
name = Jonathan Lebon
email = [email protected]
signingkey = 519CE313
[alias]
lsb = "!f() { : git branch; git bstatus \"$@\"; }; f"
format-one-patch = "!f() { : git format-patch; git format-patch ${1}^..${1} \"$@\"; }; f"
d = diff
wip = commit -am "wip"
scrap = reset --hard HEAD
uncommit = reset HEAD^
rob = reset HEAD^
nuke = reset --hard HEAD^
last = log -1 HEAD
ck = checkout
amend = commit --amend
amendpipe = -c core.commentchar=| commit --amend
amendit = commit --amend --no-edit
fix = commit --amend --no-edit -a
fixup = "!f() { : git commit; git commit -a --fixup ${1:-HEAD}; }; f"
cm = "!git checkout $(git default)"
rlog = ! sh -c 'git log --reverse --ancestry-path $1^..HEAD' - 2>/dev/null
clip = "!f() { : git log; git log -1 --format=%B ${1:-HEAD} | xsel -ib; }; f"
rei = rebase -i
rec = "!f() { git up && git rebase --continue; }; f"
rea = rebase --abort
rem = "!git rebase -i $(git default)"
cp = cherry-pick
cpc = cherry-pick --continue
cpa = cherry-pick --abort
cps = cherry-pick --skip
l = log --pretty=oneline
la = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short
lg = log --graph --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short
lc = log --pretty=format:'%Cred%ad %Cblue%an %C(yellow)%h %Creset(\"%s\")' --date=short
# I use this from hx's `pipe` command.
quote = "!f() { : git log; xargs git log -n 1 --pretty=format:'%h (\"%s\")'; }; f"
lgi = "!f() { : git log; git log-interactive \"$@\"; }; f"
lai = "!f() { : git log; NO_GRAPH=1 git log-interactive \"$@\"; }; f"
h = log --graph --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short -n 10
hh = log --graph --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short -n 20
up = add -u
bi = branch-interactive
# same as git stash show, except you can just give the stash index number
# defaults to git stash list if no index number given
# also shows untracked stashed files (if any), which are kept in the third parent of the commit
stashow = "!f() { set -e; if [ $# -eq 0 ]; then git stash list; else ( git show --color=always stash@{$1}; if git rev-parse --verify --quiet stash@{$1}^3; then git show --color=always stash@{$1}^3; fi; ) | LESS=FRX less -r; fi; }; f"
pr = "!f() { set -e; pr=$1; shift; remote=$(git default -f); git push $remote HEAD:refs/heads/pr/$pr \"$@\"; }; f"
prb = "!f() { set -e; pr=$(git rev-parse --abbrev-ref HEAD); git pr $pr \"$@\"; }; f"
prd = "!f() { : git branch ; set -e; remote=$(git default -f); while [ $# -ne 0 ]; do b=$1; shift; git branch -D $b || :; git push $remote :pr/$b || :; done;}; f"
restamp = "! git commit --amend --no-edit --date=\"$(date -R)\""
subu = submodule update --init
autosquash = -c core.editor=true rebase -i --autosquash
# from https://github.com/cgwalters/homegit/blob/master/dotfiles/gitconfig
rclean = !git clean -dfX && git submodule foreach git clean -dfX
rxclean = !git clean -dfx && git submodule foreach git clean -dfx
willadd = add -N
[pull]
rebase = true
[fetch]
prune = true
[push]
default = simple
autoSetupRemote = true
[diff]
algorithm = histogram
renames = copies
indentHeuristic = true
compactionHeuristic = true
renameLimit = 791
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
# Use a pager for large output, just like other git commands.
[pager]
difftool = true
# `git dft` is less to type than `git difftool`.
[alias]
dft = difftool
[include]
path = .gitconfig.local
[commit]
verbose = true
#[interactive]
# diffFilter = diff-highlight
[core]
pager = delta
# commentchar = |
[interactive]
diffFilter = delta --color-only
[add.interactive]
useBuiltin = false # required for git 2.37.0
[delta]
navigate = true # use n and N to move between diff sections
light = true # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
file-decoration-style = blue box bold
hunk-header-decoration-style = hidden
#width = variable
hunk-header-line-number-style = red bold
hunk-header-style = line-number syntax bold ul
[rebase]
autostash = true
updateRefs = true
[grep]
lineNumber = true
[init]
templateDir = ~/.git_templates
defaultBranch = main
[advice]
skippedCherryPicks = false
[safe]
directory = *
directory = *