-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
151 lines (148 loc) · 7.01 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
[core]
editor = /usr/bin/vim
excludesfile = /Users/andrew/.gitignore_global
[user]
name = Andrew Williams
email = williams.andrew@gmail.com
[alias]
st = status
co = checkout
ls = log --oneline
ca = commit --amend -C HEAD
dc = diff --cached
poh = push origin HEAD
pohf = push origin HEAD --force-with-lease
pom = push origin master
unstage = reset HEAD --
bclean = "!f(){ git branch --merged master | awk '$NF !~ /master/ {print $NF}' | xargs git branch -d; }; f"
anw = !git diff -U0 -w --no-color -- \"$@\" | git apply --cached --ignore-whitespace --unidiff-zero "#"
root = rev-parse --show-toplevel
# Craig's Git aliases minus ones I already defined above
# https://github.com/booch/config_files/blob/master/gitconfig
a = add
aa = !git add . && git add -u && git status
ac = !git add -A && git commit
addall = !git add . && git add -u && git status
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort
amend = commit --amend --reset-author --reuse-message=HEAD
ap = add --patch
b = branch
br = branch
branches = branch -a
c = commit -m
#ca = commit --amend
changes=diff --name-status -r
changed=diff --name-only
ci = commit -v
clear = !git add . && git stash && git stash drop
cm = commit
#co = checkout
cob = checkout -b
com = checkout master
cp = cherry-pick
create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' -
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
current-branch = rev-parse --abbrev-ref HEAD
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
#dc = diff --cached
delete-branch = !sh -c 'git push origin :refs/heads/$1 && git remote prune origin && git branch -D $1' -
delete-merged-branches = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
delete-remote-merged-branches = "!git branch -r --merged | grep -v '\\*' | sed 's/origin\\//:/' | xargs git push origin"
dh1 = diff HEAD~1
di = diff
diff-stat = diff -b --stat
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && git push
ds = diff --stat=160,120
dump = cat-file -p
fa = fetch --all
fb = "!f() { git branch -a --contains $1; }; f"
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
ff = merge --ff-only
fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
flip = !branch=$(git name-rev --name-only HEAD); git rebase --quiet --onto HEAD~2 HEAD~1 HEAD; git cherry-pick ORIG_HEAD~1; git update-ref refs/heads/$branch $(git rev-parse HEAD); git checkout --quiet $branch
flip-last = !branch=$(git name-rev --name-only HEAD); git rebase --quiet --onto HEAD~2 HEAD~1 HEAD; git cherry-pick ORIG_HEAD~1; git update-ref refs/heads/$branch $(git rev-parse HEAD); git checkout --quiet $branch
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
ft = "!f() { git describe --always --contains $1; }; f"
graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
go = checkout -B
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
history = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
home = rev-parse --show-toplevel
ignore = update-index --assume-unchanged
ignored = !git ls-files -v | grep '^[[:lower:]]' | awk '{print $2}'
ir = rebase -i origin/master
l = log --pretty=oneline -n 20 --graph --abbrev-commit
lc = log ORIG_HEAD.. --stat --no-merges
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
llog = log --date=local
ln = log --pretty=format:'%Cblue%h %Cred* %C(yellow)%s'
log-graph = log --all --graph --decorate
log-refs = log --all --graph --decorate --oneline --simplify-by-decoration --no-merges
log-timeline = log --format='%h %an %ar - %s'
log-local = log --oneline origin..HEAD
log-fetched = log --oneline HEAD..origin/master
lp = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
merge-branch = !git checkout master && git merge @{-1}
merged = branch --merged
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
next = !git add . && git rebase --continue
noff = merge --no-ff
oneline = log --oneline
ours = "!f() { git co --ours $@ && git add $@; }; f"
p = pair
patch = log -p --no-walk # Generate patch file from a commit.
pick = cherry-pick
phh = push heroku HEAD
phm = push heroku master
#poh = push origin HEAD
#pohf = push origin HEAD --force-with-lease
#pom = push origin master
pr = !hub pull-request
praise = blame
prune = remote prune
prune-all = !git remote | xargs -n 1 git remote prune
publish = git flow feature publish
pullff = pull --ff-only
put = push origin HEAD
reb = "!r() { git rebase -i HEAD~$1; }; r"
remotes = remote -v
reset-authors = commit --amend --reset-author -CHEAD
ri = rebase --interactive
rmbranch = "!f(){ git branch -d ${1} && git push origin --delete ${1}; };f"
s = status -s
search = log --pretty=short -S
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -
#st = status
staged = diff --staged
stat = status
svn-pull = !git svn fetch && git svn rebase
svn-push = !git svn dcommit
swap = !branch=$(git name-rev --name-only HEAD); git rebase --quiet --onto HEAD~2 HEAD~1 HEAD; git cherry-pick ORIG_HEAD~1; git update-ref refs/heads/$branch $(git rev-parse HEAD); git checkout --quiet $branch
tags = tag -l
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
today = log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative
tr = log --graph --oneline --decorate --color
tree = log --graph --oneline --decorate --color --all
type = cat-file -t
uncommit = reset --soft HEAD^
undo = reset --hard
unignore = update-index --no-assume-unchanged
unmerge = reset --hard ORIG_HEAD
unmerged = branch --no-merged
unpushed = !"PROJ_BRANCH=$(git symbolic-ref HEAD | sed 's|refs/heads/||') && git log origin/$PROJ_BRANCH..HEAD"
unpulled = !"PROJ_BRANCH=$(git symbolic-ref HEAD | sed 's|refs/heads/||') && git fetch && git log HEAD..origin/$PROJ_BRANCH"
#unstage = reset HEAD --
unstash = stash pop
up = !git fetch origin && git rebase origin/master
update = !git fetch origin && git rebase origin/master
wdiff = diff --word-diff=color --word-diff-regex=[a-zA-Z_0-9]+
which-branches-contain = branch -a --contains
which-tags-contain = name-rev --name-only
who = shortlog -s --
wipe = !git reset --hard; git clean -fd
[push]
default = simple
[commit]
verbose = true