如何从本地重新连接到远程存储库

发布于 2025-01-14 18:36:43 字数 346 浏览 2 评论 0原文

我从位于 bitbucket 中的团队存储库中克隆了一个存储库。我为自己创建了一个新的功能分支,并将一些代码签入了我的远程功能分支。突然我无法再连接到远程存储库。当我运行 'git push origin 时,我不断收到 'fatal:无法从重定向更新 url base:...' 错误本质上是告诉我该 URL 不起作用。我已经更新了本地分支中的更改,我想将其推送到远程分支。我该如何做到这一点,而不必删除我的本地设置并重新创建所有内容?我尝试运行 git init 但没有成功。我在 Mac 上,从终端和 VS Code 尝试过这个。预先感谢您的帮助!

I cloned a repo from my team's repository which is in bitbucket. I created a new feature branch for myself and checked in some code to my remote feature branch. Suddenly I cannot connect to the remote repository anymore. When i run 'git push origin <my-feature-branch>, I keep getting 'fatal: unable to update url base from redirection:...' error which essentially is telling me that the URL does not work. I have updated changes in my local branch that i want to push to my remote branch. how do i do this without having to delete my local setup and create everything over again? I tried running git init but no luck. I am on mac, tried this from terminal as well as VS Code. Thanks in advance for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日暮斜阳 2025-01-21 18:36:44

我不断收到致命:无法从重定向更新网址库:...

重定向是 http/https 的一项功能:服务器收到对某些 URL 的请求,发回 301、302、303等代码(例如,请参阅此 ServerFault 答案更详细的 Dr Link 检查博客条目告诉你你,或者任何发送 URL 的人,他们应该在其他地方寻找。

当 Git 得到这样的重定向时,它可以选择遵循重定向,或者抱怨(请参阅警告“重定向到”实际上意味着什么? 和 http.followRedirectsgit config 文档)。如果重定向本身是错误,它将无法遵循重定向

(通常的问题是您首先使用了错误的 URL。仔细检查 URL。)

I keep getting fatal: unable to update url base from redirection:...

Redirections are a feature of http/https: a server, getting some request for some URL, sends back a 301, 302, 303, etc., code (see, e.g., this ServerFault answer or much more detailed Dr Link Check blog entry to tell you, or whoever sent the URL anyway, that they should be looking elsewhere.

When Git gets such a redirect, it can optionally follow the redirect, or complain (see What does the warning "redirecting to" actually mean? and the git config documentation for http.followRedirects). If the redirect itself is faulty, it won't be able to follow the redirect.

(The usual problem is that you're using the wrong URL in the first place. Check the URL carefully.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文