I have my branch, say foo
, that is also on origin. I'm the only one coding to this branch. Meanwhile, master changed and I need to pull those changes and then make some more changes onto my branch and push it. So I go ahead and:
git checkout foo
get rebase master
git commit ...
git push origin foo
Except this fails because it's not a fast-forward. I would normally do --force
but we don't allow it here. If I pull origin/foo
then I either get a bunch of conflicts that had to do with the master
changes or my new changes in foo
.
What is the correct workflow for a solo branch without --force
?
You can do merge master
to your foo
instead of rebase
it on master
.
Solve conflicts, commit some changes and so on...
And then you can push
back to origin
without --force
After your finish with your branch and if you want to merge to stable branch you have to merge your foo
branch to master
:
foo: 0-----0--------(step2)---(step3)------0----0
/ \
master: 0-------0------------0---------------------(step6)