cd ~/.ssh
ls
// github_rsa github_rsa.pub known_hosts(一般是有的)
ssh-keygen -t rsa -C "xxx@xxx.com"
// 你的 git 帳號(hào)
// Generating public/private rsa key pair........
cat ~/.ssh/id_rsa.pub
// ssh-rsa AFGHJHGGH......... (注意ssh-rsa 也是!)
Setting - 添加公鑰(title 隨意)
注:
在 Mac 上用 SourceTree 克隆的時(shí)候,
出現(xiàn)了 warning: templates not found /usr/local/git/share/git-core/templates
警告,導(dǎo)致克隆失敗. 怎么辦呢.
在終端輸入
sudo mkdir /usr/local/git
sudo mkdir /usr/local/git/share
sudo mkdir /usr/local/git/share/git-core
sudo mkdir /usr/local/git/share/git-core/templates
sudo chmod -R 755 /usr/local/git/share/git-core/templates
前四條創(chuàng)建目錄,最后一條給修改目錄添加權(quán)限.
注意 sudo 創(chuàng)建目錄需要輸入當(dāng)前 Mac 用戶的密碼
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者