Development workflow when testing combination of two devel branches

I use a git development workflow where I have a master branch and several branches for bugfixes or feature development. I've found myself in a situation where I need to test if two of those unmerged branches work nice together, before either of them can be merged into master. To this end, I have created a test branch. So the branches are:

  • master
  • featureA
  • featureB
  • test

where the test branch is created by

  • git checkout -b test master
  • git merge featureA
  • git merge featureB

The test branch will never be merged; it only ever contains commits that are in either featureA or featureB. When both featureA and featureB are merged, the test branch can be safely deleted.

Based on the testing, I make changes to either featureA or featureB or both, then merge them again into test.

The problem is: I end up with huge numbers of commits on featureA and featureB. Normally, when working on a single branch, I either test the code before I commit, or I use git commit --amend a lot. But if I do git commit --amend on featureA and then a git merge featureA on test, I get a merge conflict. If I do not commit the changes on featureA, I can't switch branches to test and can't merge the changes.

Is there a way in which I can do a combined test of the functionality of the featureA and featureB branches, without creating a new commit every time I make a tiny change in either, such as by merging an amended commit, a "reset branch test hard to a state merging featureA and featureB", or in another way? I realise I could do a huge squash when I'm finally satisfied, but are there other ways without rewriting history?


0 Answers Development workflow when testing combination of two devel branches