-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
80 lines (76 loc) · 2.8 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
[alias]
## ABBREVIATION ALIASES ##
ae = blame
br = branch
cl = clone
cp = cherry-pick
d = diff
me = merge
ph = push
pl = pull
q = stash
re = restore
sh = show
sw = switch
## BASIC ALIASES ##
# add file chunks interactively
a = add --patch
# set file as intended to add
a-f = add --intent-to-add
# apply an existing commit without creating a new one
cp-n = cherry-pick --no-commit
# show staged changes
d-s = diff --staged
# download references from all remote and remove any local reference that no longer exist
f = fetch --prune --prune-tags --all
# merge and always create merge commit
me-m = merge --no-ff
# merge and use suggested message
me-s = merge --no-edit
# merge and always create merge commit with suggested message
me-ms = merge --no-ff --no-edit
# move staged, dirty and untracked (but not ignored) changes into stash
q-ph = stash push --include-tracked
# move uppermost changes from stash into working directory
q-pl = stash pop
# move staged only changes into stash
q-s = stash push --staged
# restore staged changes
re-s = restore --staged
## COMMIT ALIASES ##
# very resiliant commit with message support only
ci = "!f() { message=\"$@\"; git commit --allow-empty --allow-empty-message --message \"$message\"; }; f"
# amend last commit
ci-a = commit --amend
# amend last commit and use the same message
ci-as = commit --amend --no-edit
# commit as amend for later rebased with autosquash
ci-ra = "!f() { hash=\"$1\"; shift; restArgs=\"$@\"; git commit --fixup=amend:$hash $restArgs; }; f"
# commit as fixup for later rebased with autosquash
ci-rf = "!f() { hash=\"$1\"; shift; restArgs=\"$@\"; git commit --fixup=$hash $restArgs; }; f"
# commit as reword for later rebased with autosquash
ci-rr = "!f() { hash=\"$1\"; shift; restArgs=\"$@\"; git commit --fixup=reword:$hash $restArgs; }; f"
## ADVANCED ALIASES ##
# one liner compact log
l = log --pretty=format:'%C(bold red)%h%Creset %ad %C(bold white)%aN%Creset %s %C(yellow)%D%Creset'
# push with upstream setup
ph-o = "!f () { branch=`git rev-parse --abbrev-ref HEAD`; git push --set-upstream origin $branch; }; f"
# performs a staged and a worktree restore
re-2 = restore --staged --worktree --source HEAD
# shows the content of a stash entry based on index
q-sh = "!f() { stashIndex=${1:-0}; git stash show --patch stash@{$stashIndex}; }; f"
## G COMMAND ALIASES ##
cci-build = conventional-commit build
cci-chore = conventional-commit chore
cci-ci = conventional-commit ci
cci-docs = conventional-commit docs
cci-feat = conventional-commit feat
cci-fix = conventional-commit fix
cci-perf = conventional-commit perf
cci-refactor = conventional-commit refactor
cci-style = conventional-commit style
cci-test = conventional-commit test
cci = conventional-commit
si = super-init
su = set-user
sw-m = switch-main