-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig
163 lines (135 loc) · 4.97 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
[user]
name = Matthew J. Berger
email = matthewberger@nevada.unr.edu
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
pager = diff-so-fancy | less --tabs=4 -RFX
[fetch]
prune = true
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = matthewberger@nevada.unr.edu
smtpserverport = 587
[credential]
username = matthewjberger
[web]
browser = chrome
[rerere]
# Reuse Recorded Resolution
# allows git to remember how a hunk conflict has been resolved
# and remembers for next time
enabled = 1
autoupdate = 1
[push]
# Only push branches one at a time
default = simple
autoSetupRemote = true
[color]
ui = true
[color "branch"]
# Alter coloring by branch
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = 11
frag = magenta bold
ld = red bold
new = green bold
whitespace = red reverse
commit = yellow bold
old = red bold
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[difftool]
tool = difftool
[github]
user = matthewjberger
token = token
[gitflow "prefix"]
feature = feature-
release = release-
hotfix = hotfix-
support = support-
versiontag = v
[url "https://matthewjberger@github.com"]
insteadOf = https://github.com
[alias]
# Stage all files
a = add --all
# Modify previous commit
amend = commit -a --amend
# Apply .gitignore to committed files
apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
# Checkout file
co = checkout
# Create new branch but don't push it to the repo host
cob = checkout -b
# Commit with a message
com = commit -m
# Add and commit all changes
comma = !git add -A && git commit -m
# Use diff so fancy for diffs
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
# Edit config with $EDITOR
ec = config --global -e
# Show last commit
last = show --name-status
# Show all commits on all branches in a compact, colorized way
hist = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# Show the commit history in a nice format
histn = log --pretty=oneline
# Move current work to a different branch
moveto = "!sh -c \"git stash && git checkout $1 && git stash pop\" -"
# Create new branch and push to repo host
newbranch = "!sh -c \"git checkout -b $1 && git push --set-upstream origin $1\" -"
# Has the same effect as deleting the entire repo and re-cloning
# Except it doesn't delete files in the .gitignore, to be safe
nuke = "!sh -c \"git checkout $1 && git stash -u && git stash clear && git fetch --all && git reset --hard origin/$1 && git clean -df && git submodule update --init --recursive\" -"
# View the reflog in a user friendly way
ref = config --global alias.ref reflog --pretty=format:"%aD %h %cn %s"
# Deletes a submodule
rmsub = "!sh -c \"git rm $1 && rm -rf .git/modules/$1\" -"
# Quick commit to save progress
save = !git add -A && git commit -m 'SAVEPOINT'
# Get the current status
st = status
# Get the concise version of the current status
sts = status -s
# Clean files not under version control
tidy = clean -xdf
# Dry run of git tidy
tidydry = clean -xdn
# Undo commit but keep changes
undo = reset HEAD~1 --mixed
# Unstage all (or specified) files
unstage = reset HEAD --
# Get up to date with the origin (Use if you have local commits)
# This rebases local commits to come after any commits that are pulled down
# --prune removes remote-tracking branches that no longer exist on the remote
# This also ensures submodules are recursively updated
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Update submodules recursively. Point them to latest commit.
upsub = !git submodule init && git submodule update --remote --merge
# Undo commit and discard changes
# Commits everything in working directory and does a hard reset to remove that commit
# This is safer than simply discarding changes for good
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[url "https://github.com/"]
insteadOf = git://github.com/
[help]
autocorrect = 1
[hub]
protocol = https
[pull]
rebase = false