Git Discipline: combining multiple feature branches, but still keeping them separate?
I was going to write an answer of my own, but then I found this great answer (and a great question). It does not give you a single way to do things, but upon a careful reading, you should be able to find a workflow that suits your situation.
I'd have a common denominator branch for example "develop", where all my feature-branches would branch off from.
develop
|----featureA
|----featureB
|----featureC
Then once you want to test something out, just merge from the feature branches into develop in the combo you want, e.g.
git checkout develop
git merge featureA featureB
./test.sh
And keep the commit if you are happy with the test. If not do
git reset --hard HEAD^
and you are back to develop the way it was before you made the merge. This way you only need your feature branches and you can experiment with them in any combinations. Just remember as long as you have committed anything you can ALWAYS revert to that state by checking the reflog.
And for your git commit -a
problems, do
git reset --soft HEAD^
and you have the index the way it was just before you made the commit. Then just switch to another branch and commit there instead.