-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
123 lines (105 loc) · 4.49 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
[user]
name = hakier
email = [email protected]
[alias]
# add =====
a = add
aa = add .
ai = add -i
# remove =====
rmc = rm --cached
# do =====
m = merge
ci = commit
cia = commit --amend
ciaa = commit --amend -a
co = checkout
com = checkout master
cod = checkout develop
cob = checkout HEAD~1
# branch =====
br = branch
brn = rev-parse --abbrev-ref HEAD
# rebase =====
re = rebase
rem = rebase master
red = rebase develop
rec = rebase --continue
# push =====
p = push
po = push origin
pom = push origin master
pod = push origin develop
poa = push origin --all
pot = push origin --tags
# pull =====
pl = pull
plo = pull origin
plom = pull origin master
plod = pull origin develop
# diff =====
d = diff
dc = diff --cached
db = diff --name-status
dbm = diff --name-status master
ds = diff --stat
dsm = diff --stat master
# show =====
sh = rev-parse --short HEAD # get commit short hash
st = status
lg = log -p
ln = log --name-only
who = shortlog -s --
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
nm = branch --no-merged
im = branch --merged
la = config --get-regexp ^alias\\. #list aliases
lg1 = 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
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
tags = log --no-walk --tags --pretty='%h %d %s' --decorate=full # get commits with tags
# remote =====
rv = remote -v
rs = remote add
rao = remote add origin
rs = remote set-url
rso = remote set-url origin
# stash =====
sl = stash list
sd = stash drop
sp = stash pop
s = stash
ss = stash show
sm = stash save
sa = stash apply
# submodule =====
sdiff = !git diff && git submodule foreach 'git diff'
spush = push --recurse-submodules=on-demand
supdate = submodule update --remote --merge
# reset =====
rb = reset HEAD~1
# get root dir =====
root = rev-parse --show-toplevel
# https://hackernoon.com/lesser-known-git-commands-151a1918a60#.uvixl55kc
please = push --force-with-lease # like push --force but it checks that your local copy of the ref that you’re overwriting is up-to-date before overwriting it
commend = commit --amend --no-edit # quietly tacks any staged files onto the last commit you created, re-using your existing commit message
it = !git init && git commit -m “root” --allow-empty # both initializes your repository and creates an empty root commit
stsh = stash --keep-index # stash only unstaged changes to tracked files
staash = stash --include-untracked # stash untracked and tracked files
staaash = stash --all # stash ignored, untracked, and tracked files
shorty = status --short --branch # shorted version of git status
merc = merge --no-ff # merge always without fast-forward
grog = log --graph --abbrev-commit --decorate --all --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\" # graphical log
[push]
default = simple
[core]
autocrlf = input
[color]
ui = auto
branch = auto
status = auto
[credential]
helper = cache --timeout=99999999
[diff]
submodule = log