-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitconfig
130 lines (113 loc) · 4.05 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
[advice]
statusHints = false
[color]
ui = true
[core]
editor = vim
excludesfile = ~/.git_excludes
[github]
user = jdavis
[help]
autocorrect = 1
[init]
templatedir = ~/.git_template
[user]
name = Josh Davis
email = jdavis@users.noreply.github.com
[push]
default = matching
[alias]
# Shortcuts
a = add
aa = add --all
ap = add --patch
b = !git branches
bl = blame
c = commit -v
cl = !git clone
co = checkout
cop = checkout --patch
cp = cherry-pick
d = diff
dc = diff --cached
dt = difftool
dtc = difftool --cached
f = fetch
fa = fetch --all
gh = !git gh-pages
h = help
l = log
ls = ls-files
m = merge
ma = !git master
mnff = merge --no-ff
mff = merge --ff-only
p = pull
pr = !git pull-request
r = remote
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbi = rebase --interactive
rbs = rebase --skip
rbp = pull --rebase
rf = reflog
rs = reset
rv = revert
#s = status
# Default to shorter status with branch info
s = status -sb
sh = show
sl = shortlog
sm = submodule
st = stash
# Default to shorter status for su as well
su = status -s -b -uno
un = !git unstage
# New Commands
amend = commit --amend
branches = "!b() { git branch ${@:--vv}; }; b"
count = shortlog -sn
commiff = "!commiff() { git log --abbrev-commit --oneline HEAD...${1:-master}; }; commiff"
ctags = !.git/hooks/ctags
gh-pages = checkout gh-pages
last = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit HEAD~10..HEAD~
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(A: %ad - C: %cr) %C(bold blue)<%an>%Creset' --abbrev-commit
ln = log --graph --oneline --all --decorate --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(A: %ad - C: %cr) %C(bold blue)<%an>%Creset'
man = help
master = checkout master
sync = !git pull && git push
unstage = reset HEAD
up = "!up() { if [[ $# != 2 ]]; then echo 'git up <remote> <branch>'; exit; fi; exists=`git show-ref refs/heads/$2`; if [ -n \"$exists\" ]; then git branch -d $1/$2; fi; git branch --set-upstream-to $1/$2; }; up"
# Fixes this issue:
# http://stackoverflow.com/q/6089294
pu = !git push -u origin `git rev-parse --abbrev-ref HEAD`
# Easy alias to publish master to GitHub Pages
publish = !git checkout gh-pages && git merge master && git push origin gh-pages && git checkout master
# Found here: http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/
# Thanks to http://github.com/zdwolfe for tweeting it.
untrack = update-index --assume-unchanged
track = update-index --no-assume-unchanged
unmerged = !git --no-pager diff --name-status --diff-filter=U
# Show Git root
root = rev-parse --show-toplevel
# Easy alias for pull requests
pull-request = "!pr() { git fetch ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout -b $1 pr/$1; }; pr"
# SVN Commands
spull = !git-svn fetch && git-svn rebase
spush = !git-svn dcommit
# Fuzzy commands
# Allows adding/diffing/unstaging of files just based on providing part of the file name. Example: `g za .py` will stage all files that match `.py`
za = "!za() { if [[ $# < 1 ]]; then exit; fi; for x in \"$@\"; do git ls-files -m -o --exclude-standard | grep $x | xargs git add; done }; za"
zap = "!zap() { if [[ $# < 1 ]]; then exit; fi; for x in \"$@\"; do git ls-files -m -o --exclude-standard | grep $x | xargs git add -p; done }; zap"
zd = "!zd() { if [[ $# < 1 ]]; then exit; fi; for x in \"$@\"; do git ls-files -m -o --exclude-standard | grep $x | xargs git diff; done }; zd"
zun = "!zun() { if [[ $# < 1 ]]; then exit; fi; for x in \"$@\"; do git diff HEAD --name-only | grep $x | xargs git diff; done }; zun"
[push]
default = simple
[diff]
tool = vimdiff
[difftool]
tool = mvim -d
prompt = false
[pager]
branch = false