-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
executable file
·124 lines (114 loc) · 4.15 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
116
117
118
119
120
121
122
123
124
[include]
path = ~/.gitconfig_private
[apply]
whitespace = fix
[core]
## autocrlf = true
## safecrlf = true
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
whitespace = fix,space-before-tab,tab-in-indent,trailing-space
trustctime = false
editor = vi
[alias]
c = commit -m
a = add
br = branch
co = checkout
w = whatchanged
di = diff
dic = diff --cached
pick = cherry-pick
pl = pull
ps = push
plre = pull --rebase
st = status
out = log origin..HEAD
qpl = log --pretty=\"%Cblue%h%Creset %Cgreen[%cr]%Creset %s\" origin/production..origin/master
graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
ci = commit
ca = commit --amend
pr = remote prune origin
up = !git fetch origin && git rebase origin/master
rbc = rebase --continue
rbi = rebase -i
mm = !test `git rev-parse master` = $(git merge-base HEAD master) && git checkout master && git merge HEAD@{1} || echo "Non-fastforward"
unmgd = !git branch -r --no-merged | grep -v HEAD | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1
mgd = !git branch -r --merged | grep -v HEAD | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1
undopush= !git push -f origin HEAD^:master
cleanbranches = !"git branch --merged master | grep -v \"\\master\" | xargs -n 1 git branch -d"
## START Mutually Human GIT Scripts ##
# +head+ shows the latest commit for the current branch
head = log -n1
# +del+ will have run "git rm" on any files you deleted so git knows to delete them to
del = !"git status | grep deleted | cut -d' ' -f 5 | xargs git rm 2> /dev/null"
# +cbranch+ returns the current branch you are on
cbranch = !"git branch | grep '*' | cut -f2 -d' '"
# +rbranch+ returns the remote branch for the current branch you are on assuming it
# is named the same
rbranch = !"git branch -r | grep -E \"/`git cbranch`$\" | grep -v -e \"->\""
# +review+ shows changes in the remote branch that your current local branch does not have
review = !"git log `git cbranch`..`git rbranch`"
# +rreview+ shows changes in your local branch that its remote branch does not have
rreview = !"git log `git rbranch`..`git cbranch`"
# +pushr+ - pushes the current branch to the remote origin
pushr = !"git push --set-upstream origin `git cbranch`"
## END Mutually Human GIT Scripts ##
[push]
# default to tracking so git will only try to push the current branch
# otherwise git push will push all branches which can be problematic if you have
# changes in a branch that were not ready to be pushed (or if you use -f to force a push
# will overwrite remote branches when you only wanted to force-push the current branch)
default = tracking
[color]
ui = auto
status = auto
branch = auto
diff = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[merge]
log = true
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[mergetool]
keepBackup = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[filter "media"]
clean = git media clean %f
smudge = git media smudge %f
required = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[credential]
helper = osxkeychain