-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
94 lines (82 loc) · 2.46 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
# use separate file for username / github token / etc
[include]
path = ~/.gitconfig.local
[alias]
# add
ad = !git-fzf-add
adu = add -u
adup = add -u -p
# branch
br = branch
# clone
cl = clone --recursive # Clone a repository including all submodules.
# commit
co = commit -S
cm = commit -S -m
ca = commit -S --amend -m
fixc = commit -S --amend --reuse-message=HEAD
# config
aliases = config --get-regexp alias
# fetch
fc = fetch
# stash
load = !git stash list | fzf --select-1 --preview='' | awk -F ':' '{print $1}' | xargs -r git stash apply
drop = !git stash list | fzf --select-1 --preview='' | awk -F ':' '{print $1}' | xargs -r git stash drop
# status
ss = status -s
# switch
sw = switch
new = switch -c
cd = !git-fzf-switch
# log
l = log --pretty=format:\"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)\" --graph --date=relative --decorate --all
lg = log --graph --name-status --pretty=format:\"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset\" --date=relative
his = !git-browse
# push
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)"
# pull
pl = pull --recurse-submodules
ub = "!git pull origin $(git rev-parse --abbrev-ref HEAD) --recurse-submodules"
ub = pull --rebase origin main
# reset
rs = !git-fzf-reset
undo = reset --soft HEAD^
cancel = reset --hard HEAD^
# restore
rst = !git status -s | fzf --preview='' | awk '{print $2}' | xargs git restore
# edit conflicted file on merge
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
# add conflicted file on merge
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
[branch]
# Show most recently changed branches first.
sort = -committerdate
[color]
status = auto
diff = auto
branch = auto
interactive = auto
grep = auto
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[commit]
# https://help.github.com/articles/signing-commits-using-gpg/
gpgsign = true
[core]
editor = nvim
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = nvim -d \"$LOCAL\" \"$REMOTE\"
[mergetool "nvimdiff"]
cmd = nvim -d \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[ghq]
root = ~/Projects
[pull]
rebase = true
[init]
defaultBranch = main