forked from reorx/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
82 lines (80 loc) · 3.09 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 = Reorx
#email = [email protected]
useConfigOnly = true
email = [email protected]
name = edmund
[core]
editor = vim
excludesfile = ~/.gitignore_global
pager = diff-so-fancy | less --tabs=4 -RFX
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
tool = nvimdiff
#conflictstyle = diff3
[push]
default = current
followTags = true
[color]
ui = true
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
tool = icdiff
[difftool "icdiff"]
cmd = icdiff --line-numbers \"$LOCAL\" \"$REMOTE\"
[pager]
diff = diff-so-fancy | less --tabs=1,5 -RFX
show = diff-so-fancy | less --tabs=1,5 -RFX
[url "[email protected]:"]
insteadOf = "gh:"
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
#[http]
# proxy = http://127.0.0.1:1235
[alias]
undo = reset --soft HEAD~1
st = status -sb
ci = commit
cim = commit -m
#lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit
co = checkout
# NOTE Dangerous, use with caution
undopush = push -f origin HEAD^:master
undocommit = reset --soft HEAD^
search = "!f() { git log -p -G$1 --all; }; f"
searchcommit = "!f() { git log -G$1 --all; }; f"
branchgraph = log --all --graph --decorate --oneline --simplify-by-decoration
ls-merged = ! git branch --merged | grep -Ev '[*\\s]* (master|develop)$'
rm-merged = ! git branch --merged | grep -Ev '[*\\s]* (master|develop)$' | xargs -n 1 git branch -d
ls-merged-remote = ! git branch --remote --merged | grep origin | grep -Ev '>|master|develop' | xargs -L1 | cut -d'/' -f2-
rm-merged-remote = ! git branch --remote --merged | grep origin | grep -Ev '>|master|develop' | xargs -L1 | cut -d'/' -f2- | xargs -L 1 git push origin --delete
prune-origin = remote prune origin
lscrap = ls-files --other --exclude-standard --directory
stash-all = stash save --include-untracked
tags = tag -n99
branchupdates = for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
# try different log styles
lg = log \
--all \
--graph \
--abbrev-commit \
--date=iso \
--topo-order \
--decorate \
--format=format:'%C(magenta)%h%C(reset) -%C(yellow)%d%C(reset) %s %C(dim magenta)(%ar)%C(reset) %C(dim white)- %an%C(reset)'
l = log \
--graph \
--abbrev-commit \
--date=iso \
--topo-order \
--decorate \
--format=format:'%C(magenta)%h%C(reset) - %C(dim magenta)%ad%C(reset) %C(yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim magenta)%ar%C(reset) %C(dim white)- %an <%ae>%C(reset)'
lol = log --graph --decorate --abbrev-commit --pretty=format
tags = tag -n --sort=v:refname -l
tags-v = tag -n99 --sort=v:refname -l