情況
雖然在GitHub添加了SSH keys,但是在執行git clone https://*
命令時,仍然會提示需要輸入密碼,如下:
git clone https://github.com/yansheng8*
Cloning into '*'...
Username for 'https://github.com':
理解
之前配置SSH,需要使用ssh形式的URL(即[email protected]:*
開頭的)進行clone。
# 配置SSH
#1)本地生成key
ssh-keygen -t rsa -C "[email protected]"
#2)查看生成的key
cat cat ~/.ssh/id_rsa.pub
#3)在github個人賬戶配置key