-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
82 lines (69 loc) · 2.88 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
[user]
name = Julien Mailleret
email = [email protected]
# signingkey = <defined in local shell config>
[commit]
gpgsign = true
[core]
excludesfile = /Users/jmlrt/.gitignore_global
editor = nvim
[credential]
helper = cache
[diff]
colorMoved = default
[fetch]
prune = true
[init]
defaultBranch = main
[pager]
branch = false
[pull]
rebase = true
[push]
autoSetupRemote = true
default = upstream
[rebase]
autosquash = true
[tag]
gpgsign = true
[alias]
br = branch --sort=-committerdate
brv = branch -vv --sort=-committerdate
ci = commit --verbose
ca = commit --all
co = checkout
cp = cherry-pick
df = diff
dmb = "!git branch --merged | grep -v \"^\\*\" | grep -v \"^\\+\" | grep -v '^ master$' | grep -v '^ develop$' | xargs -n 1 git branch -d"
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset'
pl = pull --rebase
pr = "!f() { git fetch origin pull/$1/head:pr/$1; }; f"
sa = stash
st = status -sb
unstage = reset -q HEAD --
discard = checkout --
uncommit = reset --mixed HEAD~
# stash unstaged and untracked changes
stashwip = stash save -u -k "WIP"
# show recent branches
short-recent = "for-each-ref --count=25 --sort=committerdate refs/heads/ --format='%(refname:short)'"
# fuzzy add using fzf
fza = "!git ls-files -m -o --exclude-standard | fzf --print0 -m --preview 'git diff {}' --preview-window=top:10:wrap | xargs -0 -t -o git add --all"
# fuzzy switch branch... /fish/functions/fco.fish seems better
fco = "!git short-recent | fzf --print0 | xargs -0 -t git checkout"
# fuzzy fix staged changes into existing commit
ffix = !HASH=`git log --pretty=oneline | head -n 100 | fzf` && git fixit `echo ${HASH} | awk '{ print $1 }'`
# fuzzy rebase interactive choose existing commit to start from
frebase = !HASH=`git log --pretty=oneline | head -n 100 | fzf` && git rebase -i `echo ${HASH} | awk '{ print $1 }'`^
# fuzzy edit untracked/modified files
fed = !FILES=`git status -s | awk '{ print $2 }' | fzf -x -m` && nvim ${FILES}
# fuzzy edit files in conflict state
fedconflicts = !FILES=`git status -s | grep '^[UMDA]\\{2\\} ' | awk '{ print $2 }' | fzf -x -m` && nvim ${FILES}
# fuzzy gitgrep working tree for pattern and choose file(s) to edit
fgrep = !sh -c 'FILES=`git grep -l -A 0 -B 0 $1 $2 | fzf -x -m` && nvim `echo ${FILES} | cut -d':' -f1 | xargs`' -
# fuzzy select past commit, and edit current state of file(s) changed in it
fedlog = !HASH=`git log --pretty=oneline | head -n 50 | fzf` && HASHZ=`echo ${HASH} | awk '{ print $1 }'` && FILES=`git show --pretty='format:' --name-only $HASHZ | grep -v -e '^$' | fzf -x -m` && nvim ${FILES}
# fuzzy reset back to prior commit
freset = !HASH=`git log --pretty=oneline | head -n 50 | fzf` && git reset --soft `echo ${HASH} | awk '{ print $1 }'`^
[url "[email protected]:"]
insteadOf = https://github.com/