-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig.local
89 lines (83 loc) · 2.4 KB
/
.gitconfig.local
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
[user]
name = Zack Yang
email = zack9433@gmail.com
[github]
user = zack9433
[core]
pager = less -FXRS -x2
whitespace = cr-at-eol
[pretty]
colored = format:'%Cred%h%Creset %C(bold blue)%an%C(reset) - %s %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset'
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[color "branch"]
current = green bold
local = green
remote = red bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green bold
changed = yellow bold
untracked = red
[color "sh"]
branch = yellow
[push]
# push will only do the current branch, not all branches
default = current
[branch]
# set up 'git pull' to rebase instead of merge
autosetuprebase = always
[diff]
renames = copies
mnemonicprefix = true
[difftool]
prompt = false
[apply]
# do not warn about missing whitespace at EOF
whitespace = nowarn
[rerere]
enabled = true
[grep]
extendRegexp = true
lineNumber = true
[credential]
helper = osxkeychain
[rebase]
instructionFormat = "[%an - %ar] %s"
[commit]
gpgsign = true
[alias]
# list all aliases
la = "!git config -l | grep alias | cut -c 7-"
l = log --graph --pretty=colored --abbrev-commit --date=relative
diff = diff --ignore-space-at-eol -b -w --ignore-blank-lines
cnv = commit --no-verify
pnv = push --noverify
cob = checkout -b
s = status --short
br = branch -v
undo = reset --soft HEAD~1
amend = commit -a --amend<Paste>
cleanup = "!git remote prune origin && git gc && git clean -df && git stash clear"
# show what I did today
day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'"
# rebase the current branch with changes from upstream remote
update = !git fetch upstream && git rebase upstream/`git rev-parse --abbrev-ref HEAD`
# tag aliases
# show the last tag
lt = describe --tags --abbrev=0
# check out a local copy of a PR. https://gist.github.com/gnarf/5406589
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
# submodule shortcuts
si = submodule init
su = submodule update
sub = "!git submodule sync && git submodule update"