-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
92 lines (86 loc) · 2.6 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
[alias]
# check =====
h = help
la = config --get-regexp alias
s = status
df = diff --color --color-words --abbrev
l = log --color --oneline --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- # View abbreviated SHA, description, description, and history graph with no limit
ll = log --color --oneline -n 7 --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- # View abbreviated SHA, description, and history graph of the latest 7 commits
lc = log --oneline --no-merges --color --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- # clean log ignoringe all the merge commits
rem = remote -v
# do =====
up = pull
p = push
co = checkout
c = commit -m #...
ca = commit -am #...
cam = commit --amend -C HEAD # update last commit
b = branch
bc = checkout -b
bd = branch -d
bdf = branch -D
# undo =====
r = reset HEAD
rc = reset --soft HEAD^
rch = reset --hard HEAD^
rv = revert HEAD
wtf = blame -c --date=local
# Show verbose output about tags
tags = tag -l
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
# Remove the old tag with this name and tag the latest commit with it.
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
# List contributors with number of commits
contributors = shortlog --summary --numbered
# Squash with rebase
squash = !"f() { NL=$1; GIT_EDITOR=\"sed -i '2,$NL s/pick/squash/;/# This is the 2nd commit message:/,$ {d}'\"; git rebase -i HEAD~$NL; }; f"
[color]
ui = always
[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
editor = code --wait
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
tool = vscode
[merge]
log = true
tool = vscode
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[mergetool "vscode"]
cmd = code --wait $MERGED
trustExitCode = false
[difftool]
prompt = false
prompt = false
[push]
default = upstream
[user]
name = ""
email = "(none)"