【问题标题】:git remote server moved, how to update working copy configuration?git远程服务器移动,如何更新工作副本配置?
【发布时间】:2012-11-14 15:47:11
【问题描述】:

这是我目前的设置

 FDMBA:EnglishStudy willentriken$ git remote -v
 origin root@devel.phor.net:~/repos/echo.git (fetch)
 origin root@devel.phor.net:~/repos/echo.git (push)

但我们将服务器的主机名从 devel.phor.net 更改为其他名称。我可以“重新指向”我的本地 git 存储库以指向这个新的服务器地址,而不会丢失我拥有的任何本地提交等吗?

【问题讨论】:

    标签: git git-remote


    【解决方案1】:

    是的,只需使用set-url 命令

    git remote set-url origin root@newhost:repo/echo.git
    

    你可以看到结果

    git remote -v
    origin root@newhost:repo/echo.git (fetch)
    origin root@newhost:repo/echo.git (push)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-29
      • 1970-01-01
      • 2020-05-30
      • 1970-01-01
      相关资源
      最近更新 更多