master
which contains submodule SMMaster
dev
which contains submodule SMDev
feature
from dev
feature
feature
to dev
and submit for reviewfeature
to master
master
contains submodule SMDEV
SMMaster
and commit to the master
master
branch just for swithching submodules. Any better merge strategy? ThanksThe problem with your workflow is, you use the SMDev
branch for submodule. Behavior of git is correct and expected.
If you are creating the feature
branch from dev, so then you have all changes from dev to merge to the master.
First solution if you are gonna stay with your workflow is cherry-pick
instead of merging, but it is not how git is designed to work...
Do you need the SMDev
branch for submodule work with this workflow:
feature
branch off mastergit add
command for submodule.feature
to dev
feature
to masterIt introduced some manual work for developers
You can setup some hooks which can change your submodule branch when you are doing merge to master. For more information see this page: https://mirrors.edge.kernel.org/pub/software/scm/git/docs/githooks.html#_prepare_commit_msg