-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
169 lines (166 loc) · 7.48 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
[user]
name = Justin Patterson
email = [email protected]
[credential]
helper = manager
useHttpPath = true
[core]
autocrlf = true
whitespace = trailing-space,space-before-tab,indent-with-non-tab
pager = less --raw-control-chars
editor = code --wait
[push]
default = simple
# Aliases
[alias]
branch-name = "!git rev-parse --abbrev-ref HEAD"
publish = "!git push -u origin $(git branch-name)"
pub = "!git publish"
unpublish = "!git push origin :$(git branch-name)"
a = add -A
b = branch
c = checkout
co = checkout
coc = !git co master && git fp && git clean -xfd && git up && git co $1 && git up
cb = checkout -b
cob = checkout -b
cl = clean -xfd -e '*.suo' -e '*.user' -e '.vs/' -e '.cr/' -e 'packages/' -e 'node_modules/'
clp = clean -xfd -e '*.suo' -e '*.user' -e '.vs/' -e '.cr/'
clps = !git submodule foreach git clp
f = fetch
fp = fetch --prune
l = log --pretty=format:'%C(yellow)%h %Cred%ad %C(bold blue)%an%C(bold magenta)%d %Creset%s' --date=short
#l = log --pretty=format:'%C(yellow)%h|%Cred%ad|%Cblue%an|%Cgreen%d %Creset%s' --date=short
r = rebase --interactive HEAD~10
s = -p status
ec = config --global -e
pr = pull --rebase --prune
up = !git pull --rebase --prune --recurse-submodules $@ && git submodule update --init --recursive && git submodule foreach git up && echo 'git on up'
rc = rebase --continue
sa = submodule add
ra = rebase --abort
rh = reset --hard
ss = -p status -s
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
ll = log --pretty=format:'%C(yellow)%h %Cred%ad %C(bold blue)%an%C(bold magenta)%d %Creset%s' --date=short --abbrev-commit --max-count=15
lc = log --stat --summary
find = log --all --name-status --follow --
prune = fetch --prune
aliases = config --get-regexp alias
bd = branch -d
b = branch
bc = branch --contains
bl = blame -w -M -C
bra = branch -ra
brav = branch -rav
bm = branch --merged
changed = status -sb
filelog = log -u
hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) [%an]%Creset' --abbrev-commit --date=relative
last = log -p --max-count=1 --word-diff
lastref = rev-parse --short HEAD
lasttag = describe --tags --abbrev=0
pick = add -p
remotes = remote -v show
stage = add
standup = log --since yesterday --oneline --author 'Justin Patterson'
stats = diff --stat
sync = ! git fetch upstream -v && git fetch origin -v && git checkout master && git merge upstream/master
unstage = reset HEAD
who = shortlog -s -e --
wdiff = diff --word-diff
d = diff
dn = diff --name-status
dt = difftool
dtc = difftool --cached
dtd = difftool --dir-diff
mt = mergetool
mc = merge --continue
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
ane = commit -a --amend --no-edit
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git clp && git fp && git up && git bclean ${1-master}; }; f"
merged = "!f() { git b | sed \"s/\\*//\" | xargs -r -I % sh -c 'echo %;git branch --merged %;'; }; f"
mm = "!f() { git co ${1-master}; git up; git co -; git merge ${1-master}; }; f"
mms = "!f() { git tm; git stash -u; git co ${1-master}; git up; git co -; git merge ${1-master}; git stash pop; git rtm; }; f"
pushit = ! git push && echo "push it real good"
ss = submodule status
tm = "!f() { touch __nothing_to_see_here__; }; f"
rtm = "!f() { rm __nothing_to_see_here__; }; f"
g = grep --break --heading --line-number
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
sortdiff = !sh -c 'git diff "$@" | grep "^[+-]" | sort --key=1.2 | uniq -u -s1'
migrate = "!f(){ CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force `CURRENT ${3-'$CURRENT@{u}'} && git rebase --onto ${2-master} $CURRENT; }; f"
# Mark a file as "assume unchanged", which means that Git will treat it
# as though there are no changes to it even if there are. Useful for
# temporary changes to tracked files
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
unhide-all = update-index --really-refresh
hidden = "!git ls-files -v | grep ^h | cut -c 3-"
sc = svn clone --no-metadata --authors-file=users.txt
pot = push origin --tags
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
# Archive to a different ref
archive-ref = "!f(){ branch=$(git symbolic-ref --short HEAD); if [ \"$1\" == \"--push\" ]; then git push origin refs/archive/*; elif [ \"$branch\" == \"master\" ]; then echo Can not archive master; else git checkout master; git update-ref refs/archive/$branch refs/heads/$branch; git branch -D $branch; echo $branch archived; fi }; f"
list-archive-ref = for-each-ref --sort=-authordate --format='%(refname) %(objectname:short) %(contents:subject)' refs/archive/
arch = !git archive-ref
lar = !git list-archive-ref
delete-remote-archive = "!f() { nada=$(git ls-remote --exit-code origin refs/archive/$1); exists=$?; if [ $exists -eq 0 ]; then git push origin :refs/archive/$1; else echo archive $1 does not exist on origin; fi;}; f"
dra = !git delete-remote-archive
# Colors
[color]
branch = auto
diff = auto
status = auto
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[color "branch"]
current = yellow reverse
local = yellow
remote = green
upstream = bold green
[grep]
lineNumber = true
extendRegexp = true
[winUpdater]
recentlySeenVersion = 2.26.1.windows.1
[diff]
tool = bc
[difftool "bc"]
path = bcomp.exe
[merge]
tool = bc
[mergetool "bc"]
path = bcomp.exe
[difftool]
prompt = false
[tag]
sort = version:refname
[versionsort]
suffix = -*
[mergetool]
keepBackup = false
[safe]
directory = C:/source/rms/RainMaker.Database
[credential "helperselector"]
selected = manager-core
[fetch]
prune = true
[pull]
rebase = true