-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot.gitconfig
152 lines (120 loc) · 5.1 KB
/
dot.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
##
## dotfiles -- Essential Unix Dot-Files
## Copyright (c) 1995-2020 Dr. Ralf S. Engelschall <[email protected]>
## Distributed under MIT <https://opensource.org/licenses/MIT> license.
##
## ~/.gitconfig: git(1) configuration
##
#[http]
# proxy = http://proxy:[email protected]:3128
#[user]
# name = John Doe
# email = [email protected]
# username = johndoe
#[github]
# user = johndoe
# token = 00000000000000000000000000000000
[url "https://github.com/"]
insteadOf = "github:"
[url "ssh://[email protected]/"]
insteadOf = "github:"
pushInsteadOf = "github:"
[credential]
helper = cache --timeout=3600
[core]
autocrlf = input
[color]
ui = true
[color "diff"]
meta = bold
frag = bold
commit = bold
old = red
new = blue
whitespace = yellow reverse
[color "status"]
added = blue
changed = red
untracked = yellow
[push]
default = simple
followTags = true
[merge]
ff = only
conflictstyle = diff3
[branch "master"]
rebase = true
[status]
showUntrackedFiles = all
[alias]
# convenient abbreviations of standard commands (plain)
co = checkout
ci = commit
di = diff
gr = grep
mg = merge
rb = rebase
br = branch
# convenient abbreviations of standard commands (with defaults)
st = status --short --branch
br = branch --all --verbose --verbose
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(green)(%cr) %C(blue)<%an>%Creset'
# rebasing short-hands
rbi = rebase --interactive @{upstream}
rbc = rebase --continue
rbs = rebase --skip
rba = rebase --abort
# release/unrelease (given) tag to remote
release = "!f(){ git tag $1 && git push --tags; };f"
unrelease = "!f(){ git tag -d $1 && git push origin \":$1\"; };f"
# publish/unpublish (current) branch to remote
branch-name = !git rev-parse --abbrev-ref HEAD
publish = "!git push -u origin $(git branch-name)"
unpublish = "!git push origin :$(git branch-name)"
# uploading of local changes
upload = !git push && git push --tags
# upgrade local branch
upgrade-intern = !git fetch --prune --tags && git merge --ff-only || git rebase --preserve-merges
upgrade-extern = submodule update --init --recursive --remote
upgrade = !git upgrade-intern && git upgrade-extern
# working with stash
# (stash/unstash work in progress and perform point-in-time safe-guarding snapshots)
wip = stash push -a
unwip = stash pop
snapshot = "!git stash push -a -m \"snapshot: $(date)\" && git stash apply stash@{0}"
# working with index
# (stage/unstage for commmit)
stage = add --all
unstage = reset HEAD
# working with working-copy
# (revert single file or all files to comitted state)
revert = checkout --force
revert-all = reset --hard HEAD
# working with commits
# (extend content or amend the message of last commit and undo the last commit)
extend = commit --amend --no-edit -a
amend = commit --amend
undo = reset --soft HEAD^
undo-hard = reset --hard HEAD^
# mark files as "assume unchanged", which means that Git will
# treat them as though there are no changes to them, even if there
# are. Useful for local temporary changes to tracked files.
assumed = !git ls-files -v | grep ^h | cut -c 3-
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
# optimize a repository by pruning and repacking
optimize-prune = !git prune --expire=now && git reflog expire --expire-unreachable=now --rewrite --all
optimize-repack = repack -a -d -f --depth=300 --window=300 --window-memory=1g
optimize = !git optimize-prune && git optimize-repack
# delete all branches which were already merged into the "master" branch
branches-prune = "!git branch --no-color --merged master | grep -v \"\\* master\" | grep -v \"\\*\" | xargs -n 1 git branch -d"
# guidance: how to list certain things
branches = branch -a
tags = tag -n1 --list
stashes = stash list
# guidance: how to create a new branch and the reverse of "git add"
new = checkout -b
del = reset HEAD
# include optional local configuration
[include]
path = ~/.dotfiles/gitconfig