【问题标题】:How do you correct a bad git "remote add origin" command?你如何纠正一个糟糕的 git “remote add origin” 命令?
【发布时间】:2018-04-02 07:44:50
【问题描述】:

我正在尝试将文件添加到我的第一个 github.com 存储库。我在“git remote add origin”命令中拼错了我的用户名。如果我尝试再次正确执行,它会给我一个错误:

fatal: remote origin already exists.

如何清除该值以便进行更正?或者,我如何更改那里的内容?

【问题讨论】:

标签: git github


【解决方案1】:

使用 git remote set-url 更新远程 url

git remote set-url origin git://newurl

【讨论】:

  • 它有效,但我不明白“git://newurl”。我做了“git://https ...”并得到了一个错误,所以离开了“git:”并且它起作用了。
猜你喜欢
  • 2015-11-06
  • 2017-09-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-02-22
  • 2020-10-08
  • 2019-07-05
相关资源
最近更新 更多