git subtree: possible to change subtree branch/path in a forked repository?

前端 未结 1 846
暖寄归人
暖寄归人 2020-12-05 03:05

In a repository A the folder sub is included as git subtree of the repository S - pointing to master branch.

I ha

相关标签:
1条回答
  • 2020-12-05 03:49

    If you used git subtree (and not git submodule) to create the subtree, then it's just a normal dir. To switch it to another branch, just delete it and recreate the subtree from the new branch. This is:

    git rm <subtree>
    git commit
    git subtree add --prefix=<subtree> <repository_url> <branch>
    

    That should work without problems.

    0 讨论(0)
提交回复
热议问题