-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
68 lines (60 loc) · 1.99 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
# bggitconfig
# https://github.com/benvaljean/bgrc
[include]
path = ~/.gitconfig.local
[push]
default = matching
[core]
#pager = vim -c '%sm/\\e.\\{-}m//ge' -c 'set ft=diff' -c 'normal gg' -c 'set noconfirm' -c 'cmap q q!' -
pager = less -r
#[http]
# proxy = socks5://127.0.0.1:9150
[diff]
tool = vimdiff
[merge]
tool = vimdiff
[difftool]
prompt = false
[branch]
sort = committerdate
[push]
default = simple
autoSetupRemote = true
[alias]
change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter \"if [[ $`echo $VAR` = \\\"$OLD\\\" ]]; then export $VAR=\\\"$NEW\\\"; fi\" $@; }; f "
find-file = "!for branch in $(git for-each-ref --format=\"%(refname)\" refs/heads); do if git ls-tree -r --name-only $branch | grep \"$1\" > /dev/null; then echo \"${branch}:\"; git ls-tree -r --name-only $branch | nl -bn -w3 | grep \"$1\"; fi; done; :"
# https://stackoverflow.com/a/67672350/2115140
master-branch = !git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4
l = log --decorate --graph --name-status
s = status -s -b
sh = show
c = commit -v
cf = commit --fixup HEAD
co = checkout
cc = cm
cm = "!f(){ git checkout $(git master-branch) $@;}; f"
cl = checkout -
m = merge
b = !git --no-pager branch -vv
d = diff
ds = diff --staged
cp = cherry-pick
p = push
po = push -u origin HEAD
pforce = push --force-with-lease --force-if-includes
#https://github.com/alikins/gitconfig/blob/master/gitconfig
# commits not pushed to $1, master by default
unpushed = cherry -v
# url of origin, about 99% of what I use git config --list for
cloneurl = config --get remote.origin.url
amend = commit --amend
r = rebase --autosquash -i
r5 = rebase --autosquash -i HEAD~5
rebm = "!f(){ git rebase --autosquash -i $(git master-branch) ;}; f"
unstage = reset --
discard = checkout --
dis = checkout --
# from http://blog.blindgaenger.net/advanced_git_aliases.html
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ = \\2/' | sort
[pull]
ff = only