-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
83 lines (83 loc) · 2.79 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
[user]
email = [email protected]
name = with-heart
[alias]
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
la = "!git config -l | grep alias | cut -c 7-"
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
lg1 = log --graph --abbrev-commit --decorate --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
lg = !"git lg1"
cp = cherry-pick
st = status -s
cl = clone
ci = commit
cia = commit --amend
cian = commit --amend --no-edit
cinv = commit --no-verify
ciwip = commit --no-verify -m "WIP"
co = checkout
br = branch
diff = diff --word-diff
dc = diff --cached
addw = "!f() { git add **\"$1\"*; }; f"
addpw = "!f() { git add -p **\"$1\"*; }; f"
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
dsfs = dsf --staged
change-commits = "!f() { VAR1=$1; VAR='$'$1; OLD=$2; NEW=$3; echo \"Are you sure for replace $VAR $OLD => $NEW ?(Y/N)\";read OK;if [ \"$OK\" = 'Y' ] ; then shift 3; git filter-branch --env-filter \"if [ \\\"${VAR}\\\" = '$OLD' ]; then export $VAR1='$NEW';echo 'to $NEW'; fi\" $@; fi; }; f "
conflicts = diff --name-only --diff-filter=U
[commit]
template = ~/.gitmessage
[core]
excludesfile = ~/.gitignore.global
editor = "NVIM_TUI_ENABLE_TRUE_COLOR=1 nvim"
ignorecase = false
filemode = true
[push]
default = simple
[color]
ui = auto
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = 227
frag = magenta bold
commit = 227 bold
old = red bold
new = green bold
whitespace = red reverse
[includeIf "gitdir:~/code/work/"]
path = ~/code/work/.gitconfig
[diff]
tool = vscode
[difftool "vscode"]
cmd = "code --wait --diff "
[include]
path = ~/.gitconfig.local
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[branch]
sort = -committerdate
[merge "npm-merge-driver"]
name = automatically merge npm lockfiles
driver = npx npm-merge-driver merge %A %O %B %P
[pull]
ff = only
[rebase]
autoStash = true
[rerere]
enabled = true
[init]
defaultBranch = main
[url "https://github.com/"]
insteadOf = git://github.com/