git切換遠程倉庫地址


$ git remote  -v
origin  http://192.168.1.100/aaa/Project.git (fetch)
origin  http://192.168.1.100/aaaj/Project.git (push)

ChenYijun@ChenYijun-PC MINGW64 /e/git/Project (developer)
$ git remote set-url origin http://192.168.1.111/bbb/Project.git

ChenYijun@ChenYijun-PC MINGW64 /e/git/Project (developer)
$ git branch -a
* developer
  master
  remotes/origin/Project2.0.0
  remotes/origin/ProjectForMacV2.0.0
  remotes/origin/Project_Free2.0
  remotes/origin/developer
  remotes/origin/master

ChenYijun@ChenYijun-PC MINGW64 /e/git/Project (developer)
$ git remote -v
origin  http://192.168.1.111/bbb/Project.git (fetch)
origin  http://192.168.1.111/bbb/Project.git (push)

ChenYijun@ChenYijun-PC MINGW64 /e/git/Project (developer)




1、切換遠程倉庫地址:

    方式一:修改遠程倉庫地址

    【git remote set-url origin URL】 更換遠程倉庫地址,URL為新地址。

    方式二:先刪除遠程倉庫地址,然后再添加

    【git remote rm origin】 刪除現有遠程倉庫
    【git remote add origin url】添加新遠程倉庫

2、【git remote -v 】查看遠程倉庫的地址
---------------------

原文:https://blog.csdn.net/yihanzhi/article/details/78801027


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM