美文网首页
github修改完仓库名,本地git工具重设URL

github修改完仓库名,本地git工具重设URL

作者: 梁帆 | 来源:发表于2022-01-04 10:25 被阅读0次

    在github上,将仓库名my-project改成了our-project,而此时本地git工具依旧提交的还是原来的url,查看的命令是:

    git remote -v
    

    这个命令可以看到远程的仓库分支名和url,如下所示:

    origin  https://github.com/my-project.git (fetch)
    origin  https://github.com/my-project.git (push)
    

    发现还是原来的my-project,因此要修改:

    git remote set-url origin https://github.com/our-project.git
    

    改完后再查看一次:

    origin  https://github.com/our-project.git (fetch)
    origin  https://github.com/our-project.git (push)
    

    已经把url改成了远程仓库的url。
    这样你再push代码上去,就不会有错了。

    相关文章

      网友评论

          本文标题:github修改完仓库名,本地git工具重设URL

          本文链接:https://www.haomeiwen.com/subject/tprqcrtx.html