【问题标题】:How do I change the remote source of my github repo?如何更改我的 github 存储库的远程源?
【发布时间】:2012-10-12 13:45:57
【问题描述】:

我创建了一个 repo 并在我的本地机器上设置了所有内容。但是,当我执行“git remote -v”时,它会将原始存储库显示为我的获取和推送源。我希望它来自我的分叉回购。我如何在不重新开始的情况下将其更改为那个?然后,如何在原始 repo 中添加上游?

【问题讨论】:

    标签: github fork


    【解决方案1】:

    来自git remote man page

     git remote set-url origin https://github.com/user/forkname
     git remote add upstream https://github.com/maintainer/reponame
    

    另请参阅GitHub: Changing a remote's URL 的示例。

    set-url
    

    更改 URL 远程指向。

    然后您将能够从上游获取,并推送到原点:
    请参阅“What is the difference between origin and upstream in Github”。

    【讨论】:

      猜你喜欢
      • 2010-10-26
      • 1970-01-01
      • 2022-01-17
      • 2012-10-19
      • 2017-11-19
      • 2011-01-26
      相关资源
      最近更新 更多