【问题标题】:git cannot push an existing repository. 'remote-httpshttps' is not a git commandgit 无法推送现有的存储库。 'remote-httpshttps' 不是 git 命令
【发布时间】:2021-04-14 02:26:27
【问题描述】:

无法将现有的 git 存储库推送到远程。

以前没有发生过。我已经尝试安装最新版本的 git 但仍然无法推送。

git push --set-upstream origin master
git: 'remote-httpshttps' is not a git command. See 'git --help'.

【问题讨论】:

  • 你有一个新的分支 (master) 想要推送?或者应该怎么理解"git cannot push an existing repository..."。还是master 分支已经是一个remote-branch
  • remote-httpshttps 相当可疑。请参阅git remote show origin 并通过删除双 httpshttps:// 来修复 URL

标签: git git-push git-remote git-repo


【解决方案1】:

如果您有远程存储库的 HTTPS URL,请先尝试:

git remote set-url origin https://url/of/remote/repository

然后再试一次git push -u origin master

【讨论】:

  • 实际上无论我给出什么 git 命令,它总是git: 'remote-httpshttps' is not a git command. ...而且它只是通过重新打开一个新的 bash 来解决的:(
【解决方案2】:

不知道为什么.....我关闭了 git bash,然后打开了一个新的。然后就解决了:(

【讨论】:

    猜你喜欢
    • 2012-04-15
    • 2017-12-14
    • 2017-07-06
    • 2019-07-05
    • 2023-02-21
    • 2021-09-11
    • 2014-03-15
    • 2011-03-14
    相关资源
    最近更新 更多