Git设置

Git 配置

1
2
3
4
5
6
7
# 配置git
git config --global user.name "Mone Zhao"
git config --global user.email "monezhao@163.com"
git config --global color.ui true
git config --global http.sslVerify false
git config --global credential.helper store
git config --global --add safe.directory '*'

Git alias

1
2
3
4
5
6
7
8
9
git config --global alias.cp cherry-pick
git config --global alias.st status
git config --global alias.cl clone
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.df diff
git config --global alias.pl = pull
git config --global alias.ps = push

Shell设置Git快捷键

1
2
3
4
5
6
7
8
gaa='git add --all'
gcam='git commit -a -m'
gcm='git checkout master'
gd='git diff'
gl='git pull'
gmom='git merge origin/master'
gp='git push'
gst='git status'

.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
[user]
name = Mone Zhao
email = monezhao@163.com
[color]
ui = true
[http]
sslverify = false
[credential]
helper = store
[safe]
directory = *
[alias]
cp = cherry-pick
st = status
cl = clone
ci = commit
co = checkout
br = branch
df = diff
pl = pull
ps = push
[credential "http://192.168.5.106:3000"]
provider = generic
[credential "https://gitee.com"]
provider = generic
[credential "https://github.com"]
provider = generic