-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
105 lines (89 loc) · 2.79 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
[user]
name = Vadim Caen
email = [email protected]
[include]
path = ~/.dotfiles/corp/gitconfig
[color]
ui = auto
[alias]
st = status
a = add -A
ai = add -i
# Interactive add with fzf
af = "! to_add=$(git stf); [[ -n $to_add ]] && git add $to_add"
ap = add -p
ci = commit
cf = commit --fixup
cia = commit -a
ciamn = commit -a --amend --no-edit
ciam = commit -a --amend
cm = commit --amend
cim = commit --amend
cmn = commit --amend --no-edit
cimn = commit --amend --no-edit
co = checkout
con = ! gitbranchnum
cp = cherry-pick
cpc = cherry-pick --continue
cpa = cherry-pick --abort
b ="branch -l --sort=-committerdate --format=\"%(align:width=30)%(if)%(HEAD)%(then)%(color:bold green)%(end) %(HEAD) %(refname:short)%(color:reset)%(end) %(contents:subject)\""
rc = rebase --continue
ra = rebase --abort
ri = rebase -i
ria = rebase -i --autosquash
rian = "! GIT_SEQUENCE_EDITOR=: git ria"
llp = log --pretty=format:\"%Cgreen%h %>(10,trunc)%C(cyan)%aN %Creset%s\" -n 50
ll = "! git llp \"$@\" --color=always | \
fzf --reverse \
--preview 'git show --color=always --stat -p {1}' \
--preview-window='down,80%,wrap' \
--height=50% | awk '{print$1} '"
d = "! ~/.dotfiles/git/git-fzf diff"
dh ="! git d HEAD~1"
dsh = diff --stat HEAD~1
ds = diff --stat
reball = ! gitrebase
dn = "!sh -c 'if [ $# -eq 0 ] ; then git d HEAD~1 HEAD ; else git diff HEAD~`expr $1 + 1` HEAD~$1 ; fi' -"
# Reset the index but keep the commit
reskeep = "!git reset HEAD~1 && git commit --allow-empty -C HEAD@{1} "
# temp/untemp : create/remvove a temporaty commit
temp="!git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m \"TEMP\""
untemp="!git log -n 1 | grep -q -c \"TEMP\" && git reset HEAD~1"
stf="! ~/.dotfiles/git/git-fzf fzf_status"
df="stf"
# Visual git branch using rofi
vb="! git b | rofi -dmenu | awk '{print$1}'"
# Visual git log using rofi
vl="! git ll | rofi -dmenu | awk '{print$1}'"
fixup-file = "!sh -c '\
[ $(git diff --numstat $1 | wc -l) -eq 1 ] && git add $1 && \
[ $(git diff --cached --numstat $1 | wc -l) -eq 1 ] || (echo No changes staged. ; exit 1) && \
COMMIT=$(git log -n 1 --pretty=format:"%H" $1) && \
git commit --fixup=$COMMIT' -"
[diff]
tool = kitty
guitool = kitty.gui
renameLimit = 999999
[difftool]
prompt = false
trustExitCode = true
[difftool "kitty"]
cmd = kitty +kitten diff $LOCAL $REMOTE
[difftool "kitty.gui"]
cmd = kitty kitty +kitten diff $LOCAL $REMOTE
[http]
cookiefile = /usr/local/google/home/caen/.gitcookies
[log]
date = iso
[core]
pager = less -FRX
excludesfile = ~/.personal_gitignore
[pager]
log = true
[merge]
renameLimit = 999999
[repo]
superprojectChoiceExpire = 1716205018
superprojectChoice = true
[pull]
rebase = true