Let's say you have 3 branches:
- feature => branch you add the implementation
- test => other developers merge their implementations to test branch to test it
- main => main branch, implementation that goes live
Ideally, test should be equal to master
Now, let's say your feature branch conflicts with test branch (test branch includes changes which has not been added to main). However, you can't run the command git merge test because in that case you will add unverified changes to your feature branch.
What is the best practice to solve that problem?
My solution:
git checkout -b feature-test feature
# merge changes from test into feature-test
git merge test
# merge feature-test into test, test your implementation
# then release your feature branch and merge it into the main