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

前端 未结 25 2035
爱一瞬间的悲伤
爱一瞬间的悲伤 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:19

    If you're using TortoiseGit then follow the below steps:

    1. Go to your local checkout folder and right click to go to TortoiseGit -> Settings
    2. In the left pane choose Git -> Remote
    3. In the right pane choose origin
    4. Now change the URL text box value to where ever your new remote repository is

    Your branch and all your local commits will remain intact and you can keep working as you were before.

提交回复
热议问题