Mac DevEnv Building-Part.2

生成秘钥

ssh-keygen -t rsa -C "[email protected]"

提交公钥

将~/.ssh/id_rsa.pub内容复制到网站上提交

创建修改~/.ssh/config

Host github.com

HostName github.com

PreferredAuthentications publickey

IdentityFile ~/.ssh/id_rsa_github

User doraemonlu

设置~/.gitconfig

[user]

email = [email protected]

name = robbie

每次 Git 提交时都会引用这两条信息,说明是谁提交了更新,所以会随更新内容一起被永久纳入历史记录

测试成功

ssh -T [email protected]

拉取代码

git clone github.com:XXX

git clone https://github.com/XXX

git clone ssh://[email protected]:29418/XXX

你可能感兴趣的:(Mac DevEnv Building-Part.2)