-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitconfig
106 lines (77 loc) · 3.07 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
[user]
name = Brendan Heywood
email = [email protected]
[color]
diff = auto
ui = true
[core]
editor = vim
autocrlf = input
compression = 0
# Speed up on most systems that support mtime
untrackedCache = true
[alias]
# Super quick and improved shorthands
a = add
b = branch -vv --sort=committerdate
c = commit
d = diff
l = log --name-status
s = !git status && git log --oneline -n 2
# s = status
r = !"git remote -v | grep fetch | column -t"
branch-prune-remote = remote prune origin
branch-delete-merged = !"git branch --merged | grep -vE 'main|master|STABLE|\\*' | xargs -n 1 git branch -d"
commit-resetdate = commit --amend --reset-author --no-edit
# delete branch from upstread
# git push brendan --delete MDL-53047-forum-anchor
# view all commits on a ascii time line showing merges
timeline = log --graph --decorate --oneline
## Failed attempt at global custom commit template:
## status = status && git log -n 7 --oneline
# Recursively pull all submodules
pull-all = !git pull --rebase --prune $@ && git submodule update --init --recursive
pull-all-fast = "submodule foreach git pull origin master \\&"
# Recursively push all submodules
push-all = submodule foreach git push
# for git 1.7.11 and later
#push-all = push --recurse-submodules=on-demand
# Sometimes submodules are only a hash, and not a branch, this shows which ones are broken
submodule-branches = "submodule foreach --quiet 'echo \"$(git rev-parse --abbrev-ref HEAD) => $name\"'"
# This uses the new submodule branch tracking in git 1.8.2 but works in earlier too
submodule-trackbranch = "! git submodule foreach --recursive 'branch=\"$(git config -f $toplevel/.gitmodules submodule.$name.branch)\"; git checkout $branch'; "
submodule-setupstream = "! git submodule foreach --recursive 'branch=\"$(git config -f $toplevel/.gitmodules submodule.$name.branch)\"; "
# http://stackoverflow.com/questions/1777854/git-submodules-specify-a-branch-tag
# cheat sheet, not really a need for alias:
#
# maybe auto detect? status which shows tracing?
track-master = branch --set-upstream master origin/master
# Quickly squash the last two commits
squash-heaps = rebase -i HEAD~20
squash-recent = rebase -i HEAD~5
squash-last3 = rebase -i HEAD~3
squash-last = rebase -i HEAD~2
squash-auto = rebase -i --autosquash master
config-global = config --global -e
config-local = config -e
# unadd - makes more sense to me
unadd = reset
# uncommit the last commit back into staging area (need to then unadd it if you want)
uncommit = reset --soft HEAD~1
remote-all = git-remote-all
[status]
# submodulesummary = 1
[http]
# see http://stackoverflow.com/questions/2702731/git-fails-when-pushing-commit-to-github
postBuffer = 524288000
[pager]
diff = diff-highlight | less
log = diff-highlight | less
show = diff-highlight | less
[push]
default = current
recurseSubmodules = check
[pull]
default = current
[help]
autocorrect = 1