admins-MacBook-Pro:Dev sam$ git clone https://github.com/pr.git
Cloning into 'pr'...
fatal: remote error:
Repository not found.
admins-MacBook-Pro:Dev sam$ git clone git@github.com:pr.git
Cloning into 'pr'...
...
Checking connectivity... done.
如您所见,git clone
ssh
作品,但不https
. 如何使其与https
一起使用?
-
check url
如果网址正确,我们可以在输入网址时看到页面。
-
检查远程存储库是专用还是公共
如果存储库是专用存储库,则无法访问凭据或凭据错误。
而不是
git clone https://github.com/NAME/repo.git
网址应为
git clone https://username:password@github.com/NAME/repo.git