-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
103 lines (94 loc) · 3.51 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
[credential]
helper = store
[user]
email = integrityms@gmail.com
name = locate
[includeIf "gitdir:~/mobon/admin/v1/"]
path = ~/.git_company_account
[includeIf "gitdir:~/mobon/admin/v2/"]
path = ~/.git_company_account
[includeIf "gitdir:~/mobon/docker/docker_img/"]
path = ~/.git_company_account
[difftool]
prompt = true
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
[merge]
tool = vimdiff
[mergetool]
keepBackup = false
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[core]
excludesfile = ~/.gitignore_global
editor = nvim
[safe]
; directory = %(prefix)///wsl$/Ubuntu-20.04/home/ubuntu/mobon/admin/v1
; directory = %(prefix)///wsl$/Ubuntu20.04LTS/home/locate/mobon/admin/v1
; directory = %(prefix)///wsl$/Ubuntu20.04LTS/home/locate/mobon/admin/v2
directory = *
[merge "ours"]
driver = true
[alias]
s = status -s
l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
b0 = "!git branch | awk '/^\\*/{print $2}'"
sync = "!f() { git fetch $1 && git reset --hard $1/$(git b0); }; f"
bb = "! # Branch tools. Type 'git bb help' ; \n\
f() { \n\
if [ $# = 0 ]; then \
git checkout $(git branch -vv | grep -v '^\\*' | fzf | awk '{print $1}'); \
elif [ $1 = 'help' ]; then \
echo 'git bb : Select and checkout branch'; \
echo 'git bb c, clean : Clean all merged branches'; \
echo 'git bb d, D : Delete seleted branches(D: force)'; \
echo 'git bb l, list : List branches excluding the current branch'; \
echo 'git bb m, merged : List merged branches excluding the current and master branches'; \
elif [ $1 = 'd' -o $1 = 'D' ]; then \
git branch -$1 $(git bb list | fzf -m); \
elif [ $1 = 'clean' -o $1 = 'c' ]; then \
git branch -d $(git bb merged); \
elif [ $1 = 'list' -o $1 = 'l' ]; then \
git branch | grep -v '^\\*'; \
elif [ $1 = 'merged' -o $1 = 'm' ]; then \
git branch --merged | grep -v '^\\*\\|\\<master$'; \
else \
git bb help; \
fi; \
}; f"
back = "!git branch `git b0`-bak"
copy = "! # CopyBranch and Checkout; \n\
f() { \
if [ -z "$1" -a -z "$2" ]; then \
echo 'need arguments'; \
elif [ -z "$2" ]; then \
git checkout -b $1; \
else \
git checkout -b $2 $1; \
fi; \
}; f"
trashFile = "!git status -s | awk '/M / { print $2 }' | grep phpunit"
rmTrashFile = "! # rmTrashFile ; \n\
f() { \
trashFile=$(git trashFile);\
if [ ! -z $trashFile ]; then \
git rm -f $(git trashFile); \
fi; \
}; f"
ch = "! # checkout ; \n\
f() { \
if [ -z "$1" ]; then \
git checkout $(git bselect);\
else \
git checkout $1; \
fi; \
}; f"
bselect = "! # select branch with preview; \n\
f() { \
_height=$(stty size | awk '{print $1}');\
git branch | egrep -v '^\\*' | fzf --preview \"git l {1} | head -n $_height\"; \
}; f"
alias = "!git config --list | egrep '^alias.+'"
master = "!git checkout master . && git diff master `git b0` | git apply"