【问题标题】:Visual Studio pushing to wrong URL on git push: Error encountered while pushing branch to the remote repository: Git failed with a fatal errorVisual Studio 在 git push 上推送到错误的 URL:将分支推送到远程存储库时遇到错误:Git 失败并出现致命错误
【发布时间】:2020-01-29 22:34:53
【问题描述】:

这是我需要推送的 URL:

https://myVault.visualstudio.com/[root]/cxmlhub

当我尝试执行 git push 时,我收到此错误:

将分支推送到远程存储库时遇到错误:Git 因致命错误而失败。 无法通过重定向更新 url base:

要求:

https://myVault.visualstudio.com/[root]%2Fcxmlhub/info/refs&service=git-receive-pack

重定向:

https://spsprodcus1.vssps.visualstudio.com/_signin?realm=myVault.visualstudio.com&reply_to=https%3A%2F%2FmyVault.visualstudio.com[一大串foobar的废话我看不懂]

推送到

https://myVault.visualstudio.com/[root]/%2Fcxmlhub

当我第一次遇到这个错误时,我在 SO 上找到了所有处理这个错误的线程(比如 thisthisthisthis。)在查看这些线程时,我意识到解决方案是更改 GIT 尝试推送的 URL。确实错了。

我发现这个帖子告诉我如何更改 URL:How to change the URI (URL) for a remote Git repository?

按照答案中的步骤,我将remote origin URL 更改为应有的内容:

https://myVault.visualstudio.com/[root]/cxmlhub

当我执行git remote -v 时,我会返回fetchpush 的正确URL。

但是现在,当我尝试推送时,我仍然收到相同的错误,但 URL 不同。我现在得到的错误就是上面的那个。关于该错误的一些说明:

1) 我不知道为什么它似乎是在推送到正确的 URL,但是这已经结束了:

/info/refs&service=git-receive-pack

2) 我真的不明白错误消息中的 redirect 部分带有非常奇怪的 URL。

3) 在消息的末尾,在Pushing to 部分,它实际上得到了正确的 URL。但是,它实际上并没有推动。

我做错了什么,我该如何解决?

谢谢!

编辑: 不是git push gives fatal: unable to update url base from redirection: 的重复项。我已经链接到这个线程,解释说我实现了解决方案,现在我得到了一个稍微不同的错误。我觉得将其标记为重复的人实际上并没有阅读整个帖子。

【问题讨论】:

标签: git azure-repos


【解决方案1】:

根据@NoseKnowsAll answer,您可以尝试在单独的浏览器中登录myVault.visualstudio.com,然后再尝试 git push 您的更改吗?

【讨论】:

  • 是的,首先尝试了。我可以登录,但仍然出现同样的错误。
猜你喜欢
  • 2013-03-28
  • 2013-10-07
  • 1970-01-01
  • 2017-07-22
  • 2012-04-15
  • 1970-01-01
  • 2012-08-09
  • 2016-05-03
  • 2015-11-05
相关资源
最近更新 更多