开发者

Should I merge working branch to master branch of super project that has submodules?

I have a super project that has few submodules. e.g.: sub1, sub2 and sub3.

To start work, I create a branch "working" on super project. This working branch also modify code in sub1 and sub3. I create branch "working" for sub1 and sub3 too.

I commit some changes in sub1 and sub3 on "working" branch and also stage and commit changes on super project too under "working" branch.

I may then switch between "master" and "working" branch on super project and I may see my new changes are shown in "working" branch only.

Now, I want to merge the "working" branch to "master" branch. I go to sub1, merge "worki开发者_开发知识库ng" to "master". I go to sub3, merge "working" to "master".

Now, in "master" branch of super project, both sub1 and sub3 is modified. Shall I add and commit sub1 and sub3 in "master" branch and ignore "working" branch? Or I should merge "master" of super project with "working" of super project?

I am confuse here. Is the workflow I use from beginning correct with submodules?


One way to do it, after you run merge on your main project, is to use:

git submodule update --merge

You can see more details @ the git submodule man-page

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜