Moving a git repository

后端 未结 5 1799
星月不相逢
星月不相逢 2020-12-24 11:28

This question may be dumb, but I\'ve been wondering it for a while. It\'s about git repositories, but I assume it\'s the same for local repositories for other DVCS\'.

<
5条回答
  •  一生所求
    2020-12-24 12:02

    No, you wouldn't have to change anything else. That is

    • assuming no scripts set GIT_DIR, GIT_WORKTREE or GIT_INDEX directly (unlikely)
    • you have no external repositories pointing to this copy

      • if you do you'll have to repoint them by using

        git remote set-url [--push] origin user@yourhost:/home/user/newlocation/Project
        

    (origin should be the name of the remote; origin is the default name when cloning from a remote repo)

提交回复
热议问题