-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
109 lines (109 loc) · 4.13 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
[user]
name = Sean Henderson
email = [email protected]
signingkey = 524D965A7D1513EF
[github]
user = sh78
[commit]
gpgSign = true
template = ~/.gitmessage
[push]
default = current
[color]
ui = auto
[diff]
submodule = log
[column]
ui = auto,dense
[core]
excludesfile = ~/.gitignore_global
autocrlf = input
hookspath = ~/.githooks
[credential]
helper = cache --timeout 64800
[gitsh]
defaultCommand = status -s -b
[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
[init]
templatedir = ~/.gittemplate
[alias]
find = "!grepalias() { git config --global --get-regexp alias | grep -i \"$1\" | awk -v nr=2 '{sub(/^alias\\./,\"\")};{printf \"\\033[31m%_10s\\033[1;37m\", $1};{sep=FS};{for (x=nr; x<=NF; x++) {printf \"%s%s\", sep, $x; }; print \"\\033[0;39m\"}'; }; grepalias" ; courtesy of @ttscoff
ec = config --global -e
ig = !sh -c '$EDITOR .gitignore'
s = status -sb
l = log --color --graph --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset %s %Cblue<%an>%Creset' --abbrev-commit
ll = log --color --graph --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %Cgreen%ci (%cr)%Creset %Cblue<%an>%Creset%n%s' --abbrev-commit
ls = log --color --graph --stat --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %Cgreen%ci (%cr)%Creset %Cblue%an <%ce>%Creset%n%B' --abbrev-commit
lp = log --color --graph --stat -p --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %Cgreen%ci (%cr)%Creset %Cblue<%an>%Creset%n%B' --abbrev-commit
a = add
aa = add . --all
ap = add --patch
c = commit -v
ca = commit --amend -v
co = checkout
ctags = "!sh -c '[ -f .git/hooks/ctags ] || git init; .git/hooks/ctags' git-ctags"
i = init
ib = init --bare
cl = clone
d = diff -M --word-diff
dc = diff --cached -M
g = grep
au = add -u
cm = commit -m
cob = checkout -b
coB = checkout -B ; auto branch name from ref
p = push
pu = push -u ; push and set the following remote branch as default push location
pom = push origin master
pa = push --all ; push all branches
par = !sh -c 'git remote | xargs -L1 git push --all' ; push all branches to all remotes
pl = pull
plom = pull origin master
f = fetch --all
fo = fetch origin
st = stash
stp = stash pop
sts = stash save
stl = stash list
sta = stash apply
stc = stash clear
br = branch -av
brd = branch -d
brD = branch -D
brt = branch --track
rb = rebase
rbc = rebase --continue
rbi = rebase -i
rb = rebase -p
rmv = remote -v
rma = remote add
rms = remote show
rmsu = remote set-url
m = merge
rs = reset
rss = reset --soft
rss = reset --soft HEAD ; unstage working changes
rsh = reset --hard
rshh = reset --hard HEAD; discard working changes
rsho = reset --hard ORIG_HEAD ; undo merge
mkbranch = "!f() { git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1; }; f"
rmbranch = "!f() { git push origin :refs/heads/$1 && git remote prune origin && git branch -D $1; }; f"
mergebranch = "!f() { git checkout master && git merge @{-1}; }; f"
up = "!f() { git fetch origin && git rebase origin/master; }; f"
nuke = "!f() { git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch "$@"' --prune-empty --tag-name-filter cat -- --all; }; f"
acm = "!f() { git add . --all && git status -sb && echo "$@" | git commit -F -; }; f"
acmp = "!f() { git add . --all && git status -sb && echo "$@" | git commit -F - && git push; }; f"
rdone = "!f() { git add . --all && git status -sb && echo "$@" | git commit -F - && git push; }; f"
update = !git pull && git submodule update --init --recursive
grepall = "!f() { git grep "$@" $(git rev-list --all); }; f"
greplog = "!f() { git log -G "$@" --color --graph --stat -p --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %Cgreen%ci (%cr)%Creset %Cblue<%an>%Creset%n%B' --abbrev-commit; }; f"
recommit = !git commit -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG
[gpg]
program = gpg
[advice]
ignoredHook = true