【问题标题】:How to change the path?如何改变路径?
【发布时间】:2017-01-04 18:43:29
【问题描述】:

我在 GitHub 上更改了我的名字并尝试推送我的应用程序。 我尝试在 git add 和 git commit 之后推送,但没有成功。 我删除了我的存储库,现在我尝试创建一个新的存储库,但 git 不知道我的新名称:

dartnyan@PC:~/Projects/sample_app$ git remote add origin 
https://github.com/NyanTyrrell/sample_app.git
fatal: remote origin already exists.
dartnyan@PC:~/Projects/sample_app$ git push -u origin master
Username for 'https://github.com': NyanTyrrell
Password for 'https://NyanTyrrell@github.com':
remote: Repository not found.
fatal: repository 'https://github.com/newDartNyan/sample_app.git/' not found

如何将路径从 /newDartNyan/(旧名称)更改为 /NyanTyrrell/(新名称)?

【问题讨论】:

    标签: ruby-on-rails github


    【解决方案1】:

    使用remote 命令的set-url 选项。

    git remote set-url origin https://github.com/NyanTyrrell/sample_app.git
    

    这会将远程 URL 更改为提供的值,在本例中为 https://github.com/NyanTyrrell/sample_app.git

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-27
      • 1970-01-01
      • 2023-04-02
      • 2013-02-05
      • 2012-05-17
      • 2012-08-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多