Push changes in git submodule to main module but not to submodule

前端 未结 1 655
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-27 08:37

I have a git project A that uses a submodule B from Github. I cannot push to the Github project B because it is not mine. I want to do a small change in B that is not pushed to

1条回答
  •  后悔当初
    2021-01-27 09:16

    If you want to share it, you somehow have to publish it.

    One way is :

    • on github: fork project B
    • publish the commit you want on your fork
    • in project A: update the git module remote url to point to your fork, and use the commit id for the commit you created.

    At a later time, if the changes you want are integrated to upstream B, you can switch back to the original base url for project B.


    Another option, if you are ok with it, is, in your next commit on A, to stop handling B as a submodule, and integrate it as a subtree of your repo.

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