sha*_*ock 9 git https github git-clone
我分叉了一个私人存储库,我被邀请进行协作,但每次尝试使用HTTPS进行克隆时,都会收到以下错误消息:
$ git clone https://github.com/usernamex/privat-repo.git
cloning into 'privat-repo'...
Username for 'https://github.com':usernamex
Password for 'https://usernamex@github.com':
remote: Repository not found.
fatal: repository 'https://github.com/usernamex/privat-repo.git/' not found
Run Code Online (Sandbox Code Playgroud)
Note: 'usernamex' and 'privat-repo' are just examples
这是我尝试过的一些没有成功的事情:
download ZIP
按钮访问repo URL并通过浏览器下载其内容.git clone
和git push
.事实上,我可以在我的帐户中克隆并推送其他(公共)存储库.我通过终端在mac上运行git 2.10,正如我所提到的,我对HTTPS的解决方法不感兴趣(例如:SSH或GitHub桌面).
任何想法为什么会这样?
Pej*_*man 21
这个Github文件写道:
该
https://
克隆网址,可在所有存储库,公共和私人.
但是,由于您尝试访问私有存储库,因此需要进行身份验证.一种方法是在地址上附加用户名和密码,如下所示:
git clone https://username:password@github.com/usernamex/privat-repo.git
Run Code Online (Sandbox Code Playgroud)
但同一页面上写着:
如果启用了双因素身份验证,则必须创建个人访问令牌,以便在使用HTTPS URL在命令行上对GitHub进行身份验证时用作密码.
如果您启用了2FA,请查看此页面以了解生成个人访问令牌的步骤.请记住,您应该检查repo
个人令牌的完整范围(如下所示).
归档时间: |
|
查看次数: |
14679 次 |
最近记录: |