1、生成公钥,可以在第一个地方自定义位置,并添加到gitee公钥中
ssh-keygen -t ed25519 -C "xxxxx@xxxxx.com"
2、修改ssh配置文件(~/.ssh/config)
Host QISANSAN
HostName gitee.com
User git
IdentityFile ~/.ssh/id_ed25519
3、remote 添加gitee仓库
git remote -v
git remote add origin git@QISANSAN:QISANSAN/hello-world.git
git push -u origin master
ssh 会把QISANSAN映射到gitee.com 并使用对应的 IdentityFile
4、git 设置自动补全
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
git clone git://git.kernel.org/pub/scm/git/git.git
cp git/contrib/completion/git-completion.bash ~/.git-completion.bash
在~/.bashrc中添加 source ~/.git-completion.bash
echo "source ~/.git-completion.bash" >> /etc/bashrc
最后source ~/.bashrc
|