This repository has been archived by the owner on Feb 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
138 lines (115 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
# vim:filetype=gitconfig
[include]
path = ~/.gitconfig.local
[alias]
ack = "!f() { git --no-pager grep -In --break --heading \"$@\"; }; cd \"$GIT_PREFIX\" && f"
alias = config --get-regexp alias
branches = branch -avv
env = "!f() { env; }; cd \"$GIT_PREFIX\" && f"
files = "!f() { : git diff; if [ $# -eq 0 ]; then set -- master; fi; git diff --name-only $(git merge-base HEAD \"$@\"); }; cd \"$GIT_PREFIX\" && f"
find = log --all --full-history
gresolve = "!f() { : git mergetool ; git mergetool --tool=kdiff3 -y \"$@\" && echo \"Removing kdiff3 original files.\" && find ./ \\( -name '*.BASE.*' -or -name '*.BACKUP.*' -or -name '*.LOCAL.*' -or -name '*.REMOTE.*' -or -name '*.orig' \\) -delete -print; }; cd \"$GIT_PREFIX\" && f"
home = "!f() { pwd -P; }; f" ## Want to execute from the top level, not GIT_PREFIX
ignoreme = "!f() { for i in \"$@\"; do echo \"$i\" >>.gitignore; done; echo \"$(LC_ALL=C sort -u .gitignore)\" >.gitignore; sed -re '/^$/d' -i .gitignore; git add .gitignore; }; cd \"$GIT_PREFIX\" && f"
inrelease = "!f() { : git merge-base; git fetch origin master; MY_HASH=\"$(git mylasthash --merges master)\"; if [ $# -eq 2 ]; then MY_HASH=\"$1\"; shift; fi; RELEASE_HASH=\"$1\"; shift; if git merge-base --is-ancestor \"${MY_HASH}\" \"${RELEASE_HASH}\" \"$@\"; then rv=$?; echo \"Yes\"; return $rv; else rv=$?; echo \"No\"; return $rv; fi; }; cd \"${GIT_PREFIX}\" && f"
mergeflict = "!f() { : git checkout ; git pushme; git pullme --all --force && git fetch origin $1 && git merge FETCH_HEAD; }; cd \"${GIT_PREFIX}\" && f"
mine = "!f() { : git for-each-ref; git branch -vv; git for-each-ref --sort=-committerdate --format='#%(committer)#%(committerdate)#%(refname)#%(subject)' refs/remotes/origin/ \"$@\" | command grep -E \"^#$(git whoami)\" | OFS=\"#\" cut -d'#' -f 3- | column -ts'#'; }; f" ## Want to execute from top level, not GIT_PREFIX
mvbranch = "!f() { : git checkout ; git branch --unset-upstream \"$1\" && git push origin :\"$1\" && git fetch --prune; git branch -m \"$1\" \"$2\"; }; f" ## Want to execute from top level, not GIT_PREFIX
mycommits = "!f() { : git log; if [ $# -eq 0 ]; then set -- master; fi; git log --author=\"$(git whoami)\" \"$@\"; }; cd \"${GIT_PREFIX}\" && f"
mylastcommit = "!f() { : git log; if [ $# -eq 0 ]; then set -- master; fi; git log -1 --author=\"$(git whoami)\" \"$@\"; }; cd \"${GIT_PREFIX}\" && f"
mylasthash = "!f() { : git log; if [ $# -eq 0 ]; then set -- master; fi; git log -1 --author=\"$(git whoami)\" --format=\"%h\" \"$@\"; }; cd \"${GIT_PREFIX}\" && f"
pullme = "!f() { : git pull; git pull --all --force --prune \"$@\"; git update; git cleanbranches; }; f" ## Want to execute from top level, not GIT_PREFIX
pushme = "!f() { : git push; if [ -z \"$(git tracking)\" ]; then git upstream \"$@\"; else git push \"$@\"; fi; }; cd \"${GIT_PREFIX}\" && f"
pushtags = push --tags
pushyou = pushme
refs = for-each-ref refs/remotes/origin
remotes = remote -v
resolve-mine = "!f() { : git add ; if [ $# -eq 0 ]; then set -- $(git diff --name-only --diff-filter=U); fi; git checkout --ours \"$@\" && git add \"$@\"; }; cd \"$GIT_PREFIX\" && f"
resolve-ours = !git resolve-mine
resolve-theirs = "!f() { : git add ; if [ $# -eq 0 ]; then set -- $(git diff --name-only --diff-filter=U); fi; git checkout --theirs \"$@\" && git add \"$@\"; }; cd \"$GIT_PREFIX\" && f"
resolved = "!f() { : git add ; if [ $# -eq 0 ]; then set -- $(git diff --name-only --diff-filter=U); fi; git add \"$@\"; }; cd \"$GIT_PREFIX\" && f"
rmbranch = "!f() { : git checkout ; dashd=\"-d\"; if [ \"$1\" == \"-D\" ]; then dashd=\"-D\"; shift; fi; for b in \"$@\"; do git branch $dashd \"$b\"; git push origin --delete \"$b\"; done; git pull --prune; }; f" ## Want to execute from top level, not GIT_PREFIX
rmtag = "!f() { for t in \"$@\"; do git tag -d $t && git push origin :refs/tags/$t; done; }; f" ## Want to execute from top level, not GIT_PREFIX
search = log -S
stats = "!f() { : git diff; if [ $# -eq 0 ]; then set -- master; fi; git diff --stat $(git merge-base HEAD \"$@\"); }; cd \"$GIT_PREFIX\" && f"
tags = "!f() { if [ $# -eq 0 ]; then set -- 5; fi; count=\"--lines=$1\"; if [ \"$1\" == \"-a\" -o \"$1\" == \"--all\" ]; then count=\"--lines=-0\"; fi; git for-each-ref --format='%(taggerdate:raw)%(committerdate:raw)$%(taggerdate)%(committerdate)$%(refname:short)$%(authorname)%(*authorname)$%(subject)' refs/tags | sort -rn | cut -d'$' -f2- | head $count | column -ts'$'; }; f" ## Want to execute from top level, not GIT_PREFIX
this = "!f() { git branch --no-color | sed -nre 's/^\\* //p'; }; f" ## Want to execute from top level, not GIT_PREFIX
ticket = "!f() { if [ $# -eq 0 ]; then set -- \"$(git this)\"; fi; echo \"$*\" | perl -ne 's/(^|.*?[^A-Za-z0-9])([A-Za-z0-9]+-#?[0-9]+)([^A-Za-z0-9].*|$)/$2/ && print'; }; f" ## Want to execute from top level, not GIT_PREFIX
track = "!f() { if [ $# -eq 0 ]; then set -- \"$(git this)\"; fi; git branch --set-upstream-to=\"origin/$1\" \"$1\"; }; f" ## Want to execute from top level, not GIT_PREFIX
tracking = "!f() { git config --get \"branch.$(git this).merge\"; }; cd \"${GIT_PREFIX}\" && f"
undo-commit = reset HEAD^
unstage = reset HEAD
upstream = "!f() { remote=\"origin\"; if [ -n \"$1\" ]; then remote=\"$1\"; fi; git push --set-upstream \"$remote\" $(git this); }; f" ## Want to execute from top level, not GIT_PREFIX
when = "!f() { git for-each-ref --sort=-committerdate --format='%(authorname)#%(committerdate)#%(refname)#%(subject)' refs/remotes/origin/ \"$@\" | column -ts'#'; }; f"
when-added = "!f() { : git log ; follow=; if [ $# -le 1 ]; then follow=\"--follow\"; fi; git log $follow --diff-filter=A --find-renames=40% -- \"$@\"; }; cd \"$GIT_PREFIX\" && f"
who = "!f() { git for-each-ref --sort=-authorname --format='%(authorname)#%(committerdate)#%(refname)#%(subject)' refs/remotes/origin/ \"$@\" | column -ts'#'; }; f"
[add]
ignoreErrors = true
[color]
branch = auto
diff = auto
grep = auto
interactive = auto
pager = false
status = auto
ui = true
[column]
ui = never
[grep]
lineNumber = true
patternType = extended
[push]
default = upstream
[merge]
conflictstyle = diff3
stat = true
[core]
pager = less -RFXiMx4 -+S -+N
excludesfile = ~/.gitignore
safecrlf = true
abbrev = 11
whitespace = trailing-space,space-before-tab
attributesfile = ~/.gitattributes
[log]
date = local
[branch]
autosetuprebase = always
autosetupmerge = false
[pull]
ff = only
[rebase]
stat = true
autoStash = true
[help]
autocorrect = 5
[remote "origin"]
#fetch = refs/heads/*:refs/remotes/origin/*
#fetch = refs/tags/*:refs/tags/*
#fetch = refs/pull-requests/*:refs/pull-requests/*
#fetch = refs/pull/*:refs/pull/*
[diff "nodiff"]
command = true
[diff]
renames = copies
mnemonicprefix = true
interHunkContext = 10
submodule = log
indentHeuristic = true
[rerere]
enabled = true
[fetch]
prune = true
[color "grep"]
linenumber = bold yellow
filename = bold green
match = reverse yellow
[credential]
helper = store
[credintial "https://github.com/oliverhulett/dot-files.git"]
helper = store
useHttpPath = true
username = oliverhulett
[credintial "[email protected]:~oliverhulett/code-indexer-bb-frontend.git"]
helper = store
useHttpPath = true
username = oliverhulett