【问题标题】:`git push` showing error. Cannot push to `git://`. Try `https://` [duplicate]`git push` 显示错误。无法推送到 `git://`。尝试`https://` [重复]
【发布时间】:2016-12-28 03:49:02
【问题描述】:

我正在尝试推送一个 repo,并且在终端上抛出以下错误。

fatal: remote error: 
  You can't push to git://github.com/<username>/<repoName>
  Use https://github.com/<username>/<repoName>

几天前我做了一些配置更改,但我不记得我做了什么我已经更改了与 https://git:// 相关的一些内容,但我不知道如何才能让这件事再次工作。

【问题讨论】:

    标签: git github


    【解决方案1】:

    已更新,因为我之前把命令搞砸了...

    您可能更改的是远程 URL。修复它

    git remote <remote-name> set-url https://github.com/<username>/<repoName>
    

    应该这样做。 (对于&lt;remote-name&gt; 可能是origin。我假设您知道&lt;username&gt;&lt;repoName&gt; 的实际值...)

    【讨论】:

    • 远程 url 没有改变。在我执行此命令后,再次使用git remote -v 检查远程它们仍然与git:// 保持相同
    • 对不起,我弄错了命令。我相信我已经修复了它,但我不怎么处理远程更改,所以仍然可能有错误。如果这不起作用,您可以删除遥控器,然后重新添加它(使用正确的 URL)
    猜你喜欢
    • 2013-03-07
    • 2015-11-05
    • 2014-03-15
    • 1970-01-01
    • 2020-04-02
    • 2012-07-27
    • 1970-01-01
    • 2012-08-25
    • 2018-03-23
    相关资源
    最近更新 更多