-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdot_gitconfig.tmpl
125 lines (109 loc) · 3.97 KB
/
dot_gitconfig.tmpl
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
[user]
name = {{ .name }}
email = {{ .email }}
signingkey = {{ .signingkey }}
[commit]
gpgsign = true
[color]
ui = true
sh = auto
[merge]
edit = no
[push]
default = current
[core]
excludesfile = ~/.gitexcludes
editor = vim
symlinks = true
[credential]
helper = osxkeychain
[help]
autocorrect = 1
[alias]
ps = push -u
pso = ps origin
psf = ps origin -f
pra = pull --rebase --autostash
ra = reset .
rh = reset --hard
rhh = reset --hard HEAD
d = diff
ds = diff --staged
ss = status --short
co = checkout
com = checkout master
cob = checkout -b
coa = !git checkout .
b = branch
bd = !git pick | xargs git branch -d
aa = add .
ap = add -p
ac = !git add . && git commit -v
acm = !git add . && git commit -v -m
c = commit -v
cm = commit -v -m
ca = commit --amend --date=now -v
cma = commit --amend --date=now -m
commend = !git aa && git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend --date=now
pick = !git branch | grep -v "^*" | fzf
pco = !git pick | xargs git checkout
dbranch = !git pick | xargs git branch -d
l = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
lg = log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ll = log --stat --abbrev-commit
llg = log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit
ls = log --pretty=format:'%C(red)%h%C(reset) %C(blue)%ai%C(red)%d %C(reset)%s%C(green) [%cn]%C(reset)' --decorate --date=short
graph = log --graph --pretty='format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(blue){%an}%Creset' --abbrev-commit --date=relative
reset-origin = ! git reset-branch $(git rev-parse --abbrev-ref HEAD)
track = "! f() { git fetch origin && git checkout -t origin/$1; }; f"
co-pr = "! f() { git fetch origin pull/$1/head:pull-request-$1 && git checkout pull-request-$1; }; f"
# Cleaning up
cleanup-master = "! f() { git reset-branch master && git merged-branches-delete && git remote prune origin; }; f"
cleanup = "! f() { git reset-branch ${1} && git remote prune origin; }; f"
gone = "! f() { git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git b -D $branch; done }; f"
merged-branches = ! git branch --merged | grep -v "\\\\*"
merged-branches-delete = ! git merged-branches | xargs git branch -D
# Emails and Authors
authors = ! git log --all --format='%aN' | sort -u
emails = ! git log --all --format='%cE' | sort -u
fsearch = ! git ls-files | grep -i
me = ! git ls --since 3.days.ago --author `git config user.email` --branches
yesterday = ! git ls --since 1.day.ago --author `git config user.email` --branches
# Amending and resetting
fixlast = reset --soft HEAD^
rollback = reset --hard HEAD@{1}
# Remove untracked files
rm-untracked = !git status -s | grep '??' | awk '{print $2}' | xargs -I{} rm -rf {}
# Diff of current branch to other branches.
# Hope to move these into their own shell scripts
# for better customizing
unpushed = ! git log origin/$(git rev-parse --abbrev-ref HEAD).. --oneline
unpushed-stat = ! git diff origin/$(git rev-parse --abbrev-ref HEAD)..
# Alias Master Command
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort
[filter "media"]
clean = git media clean %f
smudge = git media smudge %f
required = true
[color "sh"]
dirty = red
[diff]
tool = vimdiff
[difftool]
prompt = false
[init]
defaultBranch = main
[pull]
rebase = true
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[delta]
plus-style = "syntax #012800"
minus-style = "syntax #340001"
syntax-theme = Monokai Extended
navigate = true
[interactive]
diffFilter = delta --color-only