-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgitconfig
114 lines (114 loc) · 5.37 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
# NOTE: git help {alias} shows its definition
[user]
name = Greg Vaughn
# prefer to keep email in individual repos' config
# Use GIT_AUTHOR_EMAIL env var to override or mep, meds
[push]
default = tracking
[alias]
mep = "!f() { git config user.name "Greg Vaughn"; git config user.email [email protected]; } ; f"
mea = "!f() { git config user.name "Greg Vaughn"; git config user.email [email protected]; } ; f"
mepapa = "!f() { git config user.name "Greg Vaughn"; git config user.email [email protected]; } ; f"
meds = "!f() { git config user.name "Greg Vaughn"; git config user.email [email protected]; } ; f"
mess = "!f() { git config user.name "Greg Vaughn"; git config user.email [email protected]; } ; f"
copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done"
la = "!git config -l | grep alias | cut -c 7-"
fromheroku = "!f() { heroku git:remote -a $1 -r $2; }; f" # use with $1 as heroku repo name, $2 as desired local name
; up = add -u
; hist = log --pretty=format:'%Cred%h%Creset %C(yellow)%ad%Creset | %s%Cgreen%d %Cblue[%an]%Creset' --graph --date=short
hist = log --pretty=format:'%Cred%h%Creset %C(yellow)%ad (%cr)%Creset | %s %Cblue[%an]%Creset' --graph --date=short -5
mhist = log --pretty=format:'%Cred%h%Creset %C(yellow)%ad%Creset | %s%Cgreen%d %Cblue[%an]%Creset' --graph --date=short --author greg.vaughn
g = log --oneline --all --graph --decorate --color
ll = log ORIG_HEAD..HEAD --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
lol = log --graph --decorate --pretty=oneline --abbrev-commit
churn = "!f() { git log --name-only --no-merges | grep \\.rb$ | grep -v ^vendor | sort | uniq -c | sort -nr | head -50; }; f"
so = commit -v --amend --signoff
peek = show --name-only
changed = !git log --pretty="format:" --name-only head ORIG_HEAD..HEAD | sort | uniq
headsha = rev-parse head
amend = !git commit --amend -C HEAD --date \"`date`\"
co = checkout
# look up what origin names their primary branch because of renaming
cm = "!git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
cb = checkout -b
br = branch
bd = branch -D
ci = commit
st = status
pob = push -u origin HEAD
short-recent-branches = for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(refname:short)'
long-recent-branches = for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(HEAD)%(color:yellow)%(refname:short) %(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
b = !git checkout $(git long-recent-branches | fzf --ansi --color=light --no-sort -n1| sed -E 's/(\\*)?([^ ]+).*/\\2/') # interactive branch switcher via fzf
spull = !git stash && git pull && git stash pop
bdiff = !git diff `git merge-base HEAD origin/master` #diff of branch back to branch point
diff = diff --word-diff
unstage = reset HEAD --
last = log -1 HEAD
sync = "!f() { echo syncing with master && git checkout master && git pull && git checkout - && git rebase master; }; f"
#pruneall = "!f() { git remote | xargs -n 1 git remote prune; }; f"
pruneorigin = !git checkout master && git branch -r --merged | grep -v master | sed -e 's/origin\\//:/' | xargs git push origin
prunelocal = !git checkout master && git branch --merged | grep -v master | xargs git branch -d
rtree = ls-tree -r -t master^{tree}
ctags = !.git/hooks/ctags
fixup = "!f() { git commit --amend -C HEAD --date \"`date`\"; }; f"
mru = "!f() { git for-each-ref --format='%(authordate:relative)%09%(refname:short)%0a%(subject)%0a' --sort=-committerdate refs/heads | head -20; }; f"
mybranches = "!f() { if test $# = 0 ; then set -- refs/remotes ; fi ; git for-each-ref --format='%(authordate:relative)\t%(refname:short)\t%(authoremail)' --sort=authordate \"$@\" | sed -ne \"s/\t<$(git config user.email)>//p\" | column -s '\t' -t ; } ; f"
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
commit = yellow bold
; old = red bold
; new = green bold
oldMoved = red ul
newMoved = green ul
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[color "diff-highlight"]
; NOTE I think diff-highlight is only used by diff-so-fancy
oldNormal = red bold
oldHighlight = red bold reverse
newNormal = green bold
newHighlight = green reverse
[core]
editor = nvim
excludesfile = ~/.gitignore_global
; must `brew install diff-so-fancy`
; pattern means I can use `n/N` to navigate to each file in diff
; pattern gives "Pattern not found" errors in logs and other things using pager
; pager = diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): '
pager = diff-so-fancy | less --tabs=4 -RFX
[rerere]
enabled = true
[branch]
autosetuprebase = always
[credential]
helper = osxkeychain
[init]
templatedir = ~/dotfiles/git_template
[diff]
algorithm = patience
compactionHeuristic = true
colorMoved = zebra
[mergetool]
keepBackup = false
[merge]
tool = opendiff
[help]
autocorrect = 1
[commit]
verbose = true
[diff "elixir"]
xfuncname = ^[ \t]*((def(macro|module|impl|guard|protocol)?p?|test)[ \t].*)$
[diff-so-fancy]
stripLeadingSymbols = false
[pull]
rebase = true