-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
143 lines (143 loc) · 5.77 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[user]
name = parksb
email = [email protected]
signingkey = ~/.ssh/id_ed25519.pub
[core]
excludesfile = ~/.gitignore
pager = delta
autocrlf = input
editor = nvim
ignorecase = false
fsmonitor = true
untrackedcache = true
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
features = woolly-mammoth
[merge]
conflictstyle = diff3
tool = nvim
[margetool "nvim"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c 'wincmd w' -c 'wincmd J'
[diff]
colorMoved = default
[commit]
template = ~/.stCommitMsg
gpgSign = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
alias = "!# Show all aliases;\n\
git config --list \
| egrep '^alias.+' \
| sed -e 's/^alias\\.//' \
| sed -e 's/^[^=]*=/\\'$'\\033[31m&\\033[(B\\033[m/' \
| column -t -s'=' \
| sed 's/!#* *//; s/;$//' \
| cut -c1-85"
s = "!# git status -s;\n\
git status -s"
l = "!# git log --oneline --graph --decorate --color;\n\
git log --oneline --graph --decorate --color"
la = "!# git log --all --oneline --graph --decorate --color;\n\
git log --all --oneline --graph --decorate --color"
lr = "!# git log --reflog --graph --oneline --decorate --color;\n\
git log --reflog --graph --oneline --decorate --color"
ch = "!# git checkout;\n\
_height=$(stty size | awk '{print $1}');\
git branch -r | egrep -v '^\\*' | fzf --preview \"git log --graph --oneline --decorate --color {1} | head -n $_height\" | xargs git checkout;"
sw = "!# git switch;\n\
_height=$(stty size | awk '{print $1}');\
git branch -a | grep -v origin | egrep -v '^\\*' | fzf --preview \"git log --graph --oneline --decorate --color {1} | head -n $_height\" | xargs git switch;"
re = "!# git reset;\n\
_height=$(stty size | awk '{print $1}');\
git log --pretty=format:\"%h : %s\" | fzf --preview \"git log --graph --oneline --decorate --color | head -n $_height\" | awk '{gsub(/ : .*/, \"\", $0); print $0}' | xargs git reset;"
a = "!# git add;\n\
_height=$(stty size | awk '{print $1}');\
git status -s | fzf -m --preview \"git diff {2} | head -n $_height | delta\" | awk '{print $2}' | xargs git add;"
aa = "!# git add --all;\n\
git add --all"
ap = "!# git add -p\n\
_height=$(stty size | awk '{print $1}');\
git status -s | fzf --preview \"git diff {2} | head -n $_height | delta\" | awk '{print $2}' | xargs git add -p;"
c = "!# git commit;\n\
git commit"
cv = "!# git commit -v;\n\
git commit -v"
cm = "!# git commit -m, git cm {message};\n\
git commit -m"
cun = "!# git reset HEAD~, Undo last commit;\n\
git reset HEAD~"
b = "!# git branch;\n\
git branch"
ba = "!# git branch -a, Show all branches;\n\
git branch -a"
bd = "!# git branch -D, git bd {branch}, Delete a branch;\n\
git branch -D"
bn = "!# git switch -c, git bn {branch}, Create a new branch and switch;\n\
git switch -c"
st = "!# git stash;\n\
git stash"
sts = "!# git stash save -k, git sts {stash}, Save a named stash;\n\
git stash save -k"
stl = "!# stash list, Show all stashes;\n\
_height=$(stty size | awk '{print $1}'); git stash list | awk '{gsub(/:/, \"\", $1); print $0}' | fzf --preview \"git stash show -p {1} | head -n $_height | delta\";"
stp = "!# git stash pop, Pop the stash;\n\
_height=$(stty size | awk '{print $1}'); git stash list | awk '{gsub(/:/, \"\", $1); print $0}' | fzf --preview \"git stash show -p {1} | head -n $_height | delta\" | awk '{gsub(/:/, \"\", $1); print $1}' | xargs git stash pop;"
std = "!# git stash drop, Drop the stash;\n\
_height=$(stty size | awk '{print $1}'); git stash list | awk '{gsub(/:/, \"\", $1); print $0}' | fzf --preview \"git stash show -p {1} | head -n $_height | delta\" | awk '{gsub(/:/, \"\", $1); print $1}' | xargs git stash drop;"
pl = "!# git pull;\n\
git pull"
plr = "!# git pull --rebase origin {branch};\n\
git branch | awk '/^\\*/{print $2}' | xargs git pull --rebase origin"
ps = "!# git push;\n\
git push"
pso = "!# git push origin {branch}, Push to current branch of the origin repo;\n\
git branch | awk '/^\\*/{print $2}' | xargs git push origin"
sub = "!# git restore --staged, Unstage the staged files\n\
git diff --name-only --cached | fzf -m | xargs git restore --staged;"
dtn = "!# git clean -f --, Discard the changes of the untracked files;\n\
git status -s | awk '{print $2}' | fzf -m | xargs git clean -f --"
dtna = "!# git clean -fd, Discard all untracked changes;\n\
git clean -fd --dry-run; read -p \"Are you sure? [y/N] \" -r; echo; if [[ $REPLY =~ ^[Yy]$ ]]; then git clean -fd; fi"
dt = "!# git restore, Discard the changes of the tracked files;\n\
git status -s -uno | awk '{print $2}' | fzf -m | xargs git restore"
dta = "!# git reset --hard, Discard the all staged changes;\n\
git reset --hard"
r = "!# git rebase;\n\
git rebase"
ron = "!# git rebase --onto;\n\
git rebase --onto"
rc = "!# git rebase --continue;\n\
git rebase --continue"
ra = "!# git rebase --abort;\n\
git rebase --abort"
rs = "!# git rebase --skip;\n\
git rebase --skip"
ui = "!ungit"
rv = "!# git revert;\n\
git revert"
cp = "!# git cherry-pick;\n\
git cherry-pick"
fo = "!# git fetch origin;\n\
git fetch origin"
dfo = "!# git diff origin;\n\
git diff origin"
ignore = "!# generate .gitignore file;\n\
curl -sL https://www.toptal.com/developers/gitignore/api/$@"
[fetch]
purne = true
[init]
defaultBranch = main
[gpg]
format = ssh
[pull]
ff = only
[include]
path = ~/.delta-themes.gitconfig
[include]
path = ~/.local.gitconfig