How to change the URI (URL) for a remote Git repository?

前端 未结 25 2069
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 00:28

I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved \"origin\" to a NAS and successfully tested cloning it from here.

I would like to

25条回答
  •  时光说笑
    2020-11-22 01:03

    if you cloned your local will automatically consist,

    remote URL where it gets cloned.

    you can check it using git remote -v

    if you want to made change in it,

    git remote set-url origin https://github.io/my_repo.git
    

    here,

    origin - your branch

    if you want to overwrite existing branch you can still use it.. it will override your existing ... it will do,

    git remote remove url
    and 
    git remote add origin url
    

    for you...

提交回复
热议问题