git push 给出致命错误:无法从重定向更新 url 库:
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43835309/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git push gives fatal: unable to update url base from redirection:
提问by Vyacheslav
I did commit successfully in my local repository. When I try to do:
我确实在本地存储库中成功提交。当我尝试做:
git push https://gitlab.com/priceinsight/jmt4manager/compare/develop...2-retrieve-list-userrecord# 2-retrieve-list-userrecord -v
I got this error:
我收到此错误:
Pushing to https://gitlab.com/priceinsight/jmt4manager/compare/develop...2-retrieve-list-userrecord#
fatal: unable to update url base from redirection:
asked for: https://gitlab.com/priceinsight/jmt4manager/compare/develop...2-retrieve-list-userrecord#/info/refs?service=git-receive-pack
redirect: https://gitlab.com/users/sign_in
采纳答案by Vampire
The URL you try to push to is total nonsense. You are trying to push to the URL https://gitlab.com/priceinsight/jmt4manager/compare/develop...2-retrieve-list-userrecord#
which is a webpage that compares two branches and not the URL of a repository. The repository would be https://gitlab.com/priceinsight/jmt4manager
.
您尝试推送到的 URL 完全是胡说八道。您正在尝试推送到 URL https://gitlab.com/priceinsight/jmt4manager/compare/develop...2-retrieve-list-userrecord#
,这是一个比较两个分支的网页,而不是存储库的 URL。存储库将是https://gitlab.com/priceinsight/jmt4manager
.
回答by NoseKnowsAll
I understand that your answer was already solved, but I had a very similar issue myself with a nonsense URL. The actual issue for me was that I had not logged into the company internet yet, so git was being redirected somehow through some sort of internet login page, and failing to go through.
我知道你的答案已经解决了,但我自己也遇到了一个非常类似的问题,网址是无意义的。对我来说实际的问题是我还没有登录到公司的互联网,所以 git 以某种方式通过某种互联网登录页面被重定向,并且无法通过。
The fix in this case is simple: just login in a separate browser before trying to git push
your changes.
这种情况下的修复很简单:在尝试git push
更改之前,只需在单独的浏览器中登录即可。
回答by jeremy
I also understand that your question was solved, but since I had a different solution and this is the top search result for the error, here's my ten cents...
我也明白你的问题已经解决了,但由于我有一个不同的解决方案,这是错误的最高搜索结果,这是我的十美分......
I simply had the wrong repo string. In the GCP repo viewer they given you a HEAD URL that's NOTthe same as the remote URI that you should use. In my case, the HEAD URL provided in the "Links" drop-down in the web console was:
我只是有错误的回购字符串。在GCP回购观众,他们给你一个良好的URL这是不一样的远程URI,你应该使用。就我而言,Web 控制台的“链接”下拉列表中提供的 HEAD URL 是:
https://source.cloud.google.com/[PROJECT]/[REPO]/+/master:
https://source.cloud.google.com/[PROJECT]/[REPO]/+/master:
(of course I removed the "/+/master:" at the end)
(当然我在最后删除了“/+/master:”)
Whereas my actual (correct, working) repo URL is:
而我的实际(正确的,有效的)repo URL 是:
https://source.developers.google.com/p/[PROJECT]/r/[REPO]
https://source.developers.google.com/p/[PROJECT]/r/[REPO]
I got the format from this page. Not sure why this isn't one of the options in the web portal, but oh well.
我从这个页面得到了格式。不知道为什么这不是门户网站中的选项之一,但是哦。
Hope this helps someone else!
希望这对其他人有帮助!