我有一个 Git 存储库,设置了一个远程 Web 服务器以从中提取内容。当我想从事件分支更新时,我只需登录并运行“git pull”,一切都很好。
我必须重命名 Github 上的存储库,并使用以下方法更新远程网络服务器上的引用:
git remote set-url origin https://github.com/[organisation]/[repo]
完成此操作后,我运行:
git remote -v
这证实了远程存储库名称已更新,但是当我随后运行 git pull 时,我收到错误:
The requested URL returned error: 403 Forbidden while accessing https://github.com/[organisation]/[repo].git/info/refs
我做错了什么?我错过了一个步骤吗?
最佳答案
啊,明白了...如果您通过 HTTPS(而不是 SSH)连接,我正在使用有关更新的说明。在该实例中运行的正确命令是:
git remote set-url origin <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="52353b2612353b263a27307c313d3f" rel="noreferrer noopener nofollow">[email protected]</a>:[organisation]/[repo].git
来自:https://help.github.com/articles/changing-a-remote-s-url/
关于git - 更新远程服务器以从重命名的 Git 存储库中提取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30781793/