-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
140 lines (122 loc) · 5.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
139
140
[core]
editor = vim
abbrev = 12
[push]
default = simple
[pull]
ff = only
[log]
decorate = true
[status]
submoduleSummary = true
[ui]
color = auto
[help]
autocorrect = 1
[rerere]
enabled = true
[alias]
# show one log with graph
cslog=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
mycslog=!git log --author=\"$(git config --get user.name)\" --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
gi="!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi"
a = add
# amd = commit --amend
amend = commit --amend
loghead = log $(git rev-parse --abbrev-ref --symbolic-full-name @{u}) ^HEAD
st = status
# ama = commit --amend -a
# amna = commit --amend --no-edit -a
# amupd = commit --amend --no-edit --date=\"$(date -R)\" -a
b = branch -v
bd = branch -D
# bl = fancy-branch-list
# bm = branch -M
# bn = rev-parse --abbrev-ref HEAD
br = branch -v -r
# bu = branch -u
# buo = !sh -c 'git bu origin/$(git bn)'
# buom = !sh -c 'git bu origin/master'
# c = commit
# ca = commit -a
# cam = commit -a -m
# chop1 = reset --hard HEAD~1
# chop2 = reset --hard HEAD~2
# chr = cherry-pick
# cm = commit -m
# co = checkout
# cont = !git-continue
# cp1 = chop1
# cp2 = chop2
# ctags = !sh -c '~/.files/ctags.sh $@' -
# d = "!git diff"
# ec = "!vim `git rev-parse --git-dir`/config"
# f = fetch
# ftl = !sh -c 'git fixup-to-last $@' -
# ful = !sh -c '~/.files/git-fixup/git-fixup $@' -
# g = "!git grep"
# l = "!git log"
# l1 = "!git log -1"
# last = !sh -c 'T=`git tb` && git log ${T}@{1}..${T} $@' -
# lc = !sh -c 'git log `git tb`..HEAD $@' --
# lc1 = !sh -c 'git log `git tb`..HEAD --oneline $@' --
# lcr = !sh -c 'git log --reverse `git tb`..HEAD $@' --
# lig = "!git ls-ignored"
# n = next
# nc = "!git anticom"
# next = !sh -c 'T=`git tb` && git log ${T}.. $@' -
# oc = !sh -c 'git commit-orig $@' -
# p = push
# r- = !sh -c 'git reset --hard $@' -
# r-h = reset HEAD
# rb = rebase
# rbh = !sh -c 'git rebase -i HEAD~$1' -
# rbt = !sh -c 'T=`git tb` && git rebase --autosquash $1 ${T} $@' -
# rbi = !sh -c 'T=`git tb` && git rebase --autosquash -i $1 ${T} $@' -
# ron = !sh -c 'git rebase $1 --onto $2' -
# arb = !sh -c 'git absorb $@ && git rbi' -
# rt = remote
# s = status
# sh = "!git show"
# sh1 = "!git show HEAD~1 $@"
# sh2 = "!git show HEAD~2 $@"
# sh3 = "!git show HEAD~3 $@"
# sh4 = "!git show HEAD~4 $@"
# sh5 = "!git show HEAD~5 $@"
# sh6 = "!git show HEAD~6 $@"
# sh7 = "!git show HEAD~7 $@"
# sh8 = "!git show HEAD~8 $@"
# tb = "!git tracking-branch"
# todo = "!vim `git rev-parse --git-dir`/todo.md"
# # What refs contains the sha
# whatrelease = name-rev --name-only
# contains = branch --contains
# # What is the tracking branch of the current branch
# tracking-branch = rev-parse --abbrev-ref --symbolic-full-name @{u}
# # from https://github.com/cypher/dotfiles/blob/master/gitconfig
# ls-ignored = ls-files --exclude-standard --ignored --others
# list-untracked = !sh -c 'git status --porcelain | grep '^??' | cut -c4-' -
# add-prefix = !sh -c 'T=`git tb` && git tag-commits ${T} --add-prefix $@' -
# add-suffix = !sh -c 'T=`git tb` && git tag-commits ${T} --add-suffix $@' -
# add-unmerged = "!f() { git diff --name-status --diff-filter=U | cut -f2 ; }; git add `f`"
# root-conf = !sh -c 'cat ~/.files/gitconfig'
# anticom = !sh -c 'git reset --soft HEAD^'
# commit-orig = !sh -c 'git commit -C ORIG_HEAD $@' -
# diff-fancy = "!git -c color.diff=off -c pager.diff='fancydiff stdin --pager=less' diff $@"
# edit-unmerged = "!f() { git diff --name-status --diff-filter=U | cut -f2 ; }; eb `f`"
# empty-branches = !sh -c 'T=`git tb` && git branch --merged ${T} $@' -
# first-not-mine = !sh -c 'git --no-pager log $@ --perl-regexp --author=\"^((?!$(git config user.name)).*)$\" -n 1 --pretty="%H"' -
# graph = "!git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
# log-fancy = "!git -c color.diff=off -c pager.log='fancydiff stdin --pager=less' log $@"
# show-fancy = "!git -c color.diff=off -c pager.show='fancydiff stdin --pager=less' show $@"
# # typos
# lgo = "!git log"
# gerp = "!git grep"
# branc = branch
# rebae = rebase
# statuus = status
# tatus = status
# sattus = status
# remtoe = remote
# dif = "!git diff"
# vim: filetype=gitconfig