1 编写脚本install_git.sh
在脚本中修改你的git_email和git_name
git_email=vk.gmail.com
git_name=vk
sudo apt-get install git << EOF
y
1
EOF
sudo apt-get install meld
sudo touch ~/.git-credentials
sudo echo "" > ~/.gitconfig
sudo cat << EOF >>~/.gitconfig
[user]
email = liu.bao.long.vk@gmail.com
name = vk
[core]
editor = vi
fileMode = false
quotepath = false
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
path = /usr/bin/meld
[merge]
tool = meld
[mergetool "meld"]
path = /usr/bin/meld
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
st = status
b = branch
[color]
ui = true
[credential]
helper = store
[push]
default = simple
[http]
postBuffer = 1048576000
lowSpeedLimit = 0
lowSpeedTime = 999999
EOF
2. 执行脚本
注意执行脚本不要用root权限
./install_git.sh