-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
215 lines (172 loc) · 6.65 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#########################################################
## CUSTOM VALUES - CHANGE THIS IF YOU ARE NOT ME!
#########################################################
[user]
name = Antonio Netto
email = [email protected]
[github]
user = anettodev
#########################################################
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
tool = opendiff
summary = true
verbosity = 1
[mergetool]
keepBackup = false
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
[alias]
# stash
ss = stash # stash changes
sl = stash list # list stashes
sa = stash apply # apply stash (restore changes)
sd = stash drop # drop stashes (destory changes)
# status
s = status # status
st = status # status
stat = status # status
# diff
d = diff # diff unstaged changes
dc = diff --cached # diff staged changes
last = diff HEAD^ # diff last committed change
# Shows list of contributors of a repository.
contributors = shortlog --summary --numbered --email
# log
l = log --graph --date=short
lg = log -p
plog = log --pretty=format:\"%h %Cblue%cr%Creset %cn %Cgreen%s%Creset\"
graph = log --graph --pretty=oneline --abbrev-commit
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
simple = log --pretty=format:\" * %s\"
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
# List commits in short form
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
# List commits showing changed files
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
le = log --oneline --decorate
# add
a = add # add
au = add -u # add changed files but not new ones.
# tag
t = tag -n # show tags with <n> lines of each tag message
# List Aliases
la = "!git config -l | grep alias | cut -c 7-"
# Prune
pr = prune -v
# cherry-pick
cp = cherry-pick -x # grab a change from a branch
#############
# via http://philjackson.github.io/2013/04/07/handy-git-tips-to-stop-you-getting-fired.html
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
snapshots = !git stash list --grep snapshot
#via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)'
#############
# Removes a file from the index
unstage = reset HEAD --
undo = reset --hard
# my stuffs
mt = mergetool
sub-update = "!git submodule update --init --recursive --remote"
checkouts = "!sh -c \"git submodule foreach --recursive 'git checkout $1'\""
pulls = "!sh -c \"git submodule foreach --recursive 'sleep 2 && git pull origin $1'\""
statuss = "!git submodule foreach --recursive git status"
pushs = "!git submodule foreach --recursive git push origin || true"
cleans = "!git submodule foreach --recursive 'git checkout . && git clean -df && git reset HEAD —-hard && git checkout master && git pull'"
##########################################################
## BE AWARE!
## Most of the config below you do not need to change.
##
#########################################################
[format]
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
[core]
# the parameter -w, --wait is to wait for window to be closed before returning.
# Visual Studio Code is base on Atom Editor. if you also have atom installed execute the command atom --help.
# You will see the last argument in the help is wait.
# Next time you do a git rebase -i HEAD~3 it will popup Visual Studio Code.
# Once VSCode is close then Git will take back the lead.
editor = code --wait
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
# Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red bold # deletions
new = green bold # additions
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
# instead of a/b/c/d as prefixes for patches
mnemonicprefix = true
algorithm = patience
# Detect copies as well as renames
renames = copies
[help]
# Automatically correct and execute mistyped commands
autocorrect = 1
[push]
# change to maching for machines with older versions of git 1.x.x
default = simple
autoSetupRemote = true
[url "[email protected]:github"]
insteadOf = "https://github.com/github"
insteadOf = "github:github"
insteadOf = "git://github.com/github"
[url "[email protected]:"]
pushInsteadOf = "https://github.com/"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
# Uncomment if you want fetch to also get all github pull requests, this is rather
# large on big repos.
#[remote "origin"]
#fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
[commit]
gpgsign = false
[pull]
rebase = true
[rerere]
# Remember my merges
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
enabled = true