forked from scrooloose/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
115 lines (98 loc) · 4.06 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
[user]
name = Kenneth Miles
email = [email protected]
[color]
ui = true
[core]
whitespace = trailing-space,space-before-tab,indent-with-non-tab
[alias]
#######Shorten stuff
co = checkout
br = branch
st = status
stat = status
#Rebase with upstream
r = !"git fetch && git rebase -i $( git upstream )"
ro = !"git reset origin/$(git this) --hard"
#######Do some cool stuff
#Typo
amend = commit --amend
ammend = amend
ss = status -sb -uno
ssu = status -sb -unormal
#Sort refs perty like¬
sortrefs = for-each-ref --sort='-committerdate'
sortrefsp = for-each-ref --sort='-committerdate' --format='%(refname:short) (%(authordate))'
#What needs to be cleaned up?
gerritcleanup = "!for i in $( git for-each-ref --format='%(refname)' refs/heads/OZLAU* ); do echo \"branch: $i\"; git --no-pager log classic..$i | git shortlog; done"
gerritcleanup1 = "!for i in $( git for-each-ref --format='%(refname)' refs/heads/OZLAU* ); do echo \"branch: $i\"; git ll classic..$i ; done"
#branches sorted by time of last commit
brage = "!f() { git for-each-ref --sort=committerdate refs/heads $1 --format=\"%(refname:short)\" ; }; g() { for C in $(f $1) ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; done; }; g ""}"
brageall = !git brage refs/remotes
#Advanced branch list.
tbr = branch -tavv
rbr = ls-remote --heads
#What topic branches can i delete?
merged = branch --merged
#File listings
ls-ignored = ls-files --exclude-standard --ignored --others
#logs
l = log --no-merges
lc = log ORIG_HEAD.. --stat --no-merges
ll = log --pretty=nice --abbrev-commit --date=relative
lg1 = log --graph --all --pretty=nice --abbrev-commit --date=relative
lg2 = log --graph --all --abbrev-commit --pretty=longnice
lg = !"git lg1"
lself = !git l --author=kenm
slog = !git log ...classic | git shortlog
#more logs
rawlog = log --format=\"format:commit %H%nAuthor:%an%n%n%B%n\"
justpushed = log origin/classic@{\"1 days ago\"}..origin/classic
#Find bugs
findbug = "!sh -c 'git log --grep='^[[:space:]]*OZLAU[-_]$1'' -"
bugrelease = "!sh -c 'git name-rev --tags --name-only $(git log --grep='^[[:space:]]*OZLAU[-_]$1' --pretty=\"format:%H\n\")' -"
#reflog
rlog = reflog --date=relative
hotfixes = !"git ll master..HEAD"
missing = !"git ll HEAD..master"
wtf = !"echo \"$(tput setaf 1)hotfixes$(tput sgr0):\" ;git --no-pager hotfixes ; echo ''; echo \"$(tput setaf 1)missing$(tput sgr0):\" ; git --no-pager missing; echo '' "
######GREP STUFF
#grep with special stuff
g = grep --break --heading --line-number
#search index
gi = !git g --cached
gdi = diff-index --cached
glf = log -G
gl = "!sh -c 'git log --grep='$1' --format=nice $2' -"
gl1 = "!sh -c 'git log --grep='$1' --oneline $2' -"
d = !git difftool --extcmd=icdiff -y
dl = !git difftool -t intellij develop...
di = !git difftool -t intellij
#What branch contains a following sha1.
contains = branch --contains
this = rev-parse --abbrev-ref HEAD
cloneurl = config --get remote.origin.url
#What is the upstream branch?
upstream = rev-parse --symbolic-full-name --abbrev-ref HEAD@{upstream}
authors = !"git l --format='%aN <%aE>' HEAD | sort -u"
alias = !"git config --list | grep alias"
#Show stash
lstash = !"for i in $(git --no-pager stash list --format=\"%gd\"); do echo \"List stash: $i\"; git stash show $i; done"
sstash = !"for i in $(git --no-pager stash list --format=\"%gd\"); do echo \"List stash: $i\"; git --no-pager stash show -p $i; done"
#link upstream
up = !"git branch --set-upstream-to=origin/$(git this) $(git this)"
[grep]
#Make git grep play nice
extendRegexp = true
lineNumber = true
[pretty]
nice = format:%C(blue)%h %C(green)(%ar) %C(bold black)%an - %C(reset)%s%C(yellow)%+d%C(reset)
longnice = format:%C(blue)%h %C(cyan)%ad %C(green)%ar %C(bold black)%an%C(reset)%C(yellow)%+d%n%C(reset)%s
[push]
default = current
[merge]
tool = vimdiff
[diff]
tool = intellij
[difftool "intellij"]
cmd = '/Applications/IntelliJ IDEA 14.app/Contents/MacOS/idea' diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")