Git从只读远程设备拉取失败
我有一个分叉私有存储库的克隆,我正试图为其设置只读远程存储库 我已运行以下程序来设置内容: 克隆回购协议Git从只读远程设备拉取失败,git,github,Git,Github,我有一个分叉私有存储库的克隆,我正试图为其设置只读远程存储库 我已运行以下程序来设置内容: 克隆回购协议 git clone git@github.com:scottsuch/repo.git 向上游添加只读 git remote add upstream git://github.com/org-name/repo.git 下面是git remote-v show的输出 origin git@github.com:scottsuch/repo.git (fetch) origin gi
git clone git@github.com:scottsuch/repo.git
向上游添加只读
git remote add upstream git://github.com/org-name/repo.git
下面是git remote-v show的输出
origin git@github.com:scottsuch/repo.git (fetch)
origin git@github.com:scottsuch/repo.git (push)
upstream git://github.com/org-name/repo.git (fetch)
upstream git://github.com/org-name/repo.git (push)
现在,如果我试图通过git pull upstream master从上游引入更改,我会得到以下响应:
fatal: remote error:
Repository not found.
我相当肯定这是一个标准的程序,并且已经看到了很多这样的例子。但是我不确定是否有一些权限问题。提前感谢。原始存储库是私有的,因此您需要先进行身份验证,然后才能访问它。您当前的远程URL不是为身份验证而配置的,而是为公共访问而配置的 更改<代码>git://github.com/org-name/repo.git到其中一个
使用SSH密钥,或git@github.com:org name/repo.git
通过HTTPS使用密码身份验证https://github.com/org-name/repo.git
和git远程设置上游url
git远程设置url——向上游推送
git remote set url--push-upstream来中断推送urlgit://github.com/org/repo.git
。它可以工作,但感觉很笨拙。git@
和https://
版本允许您向GitHub进行身份验证,第一个使用SSH密钥,第二个使用HTTP身份验证。目标存储库对GitHub的权限将决定您可以做什么和不能做什么。如果目标存储库是私有的,则必须先进行身份验证,然后才能从中获取或提取。这与GitHub的web UI没有什么不同;您需要先登录,然后才能访问私有存储库。