Why am I merging "remote-tracking branch 'origin/develop' into develop"?

Viewed 104866

I'm the only one in my organization who's making commits with the following message:

Merge remote-tracking branch 'origin/develop' into develop

Not sure what I'm doing to cause them, but I'd like to stop.

What command am I issuing to create this commit, and what is the proper command I ought to be using to not produce it?

3 Answers

Merge remote-tracking branch 'origin/develop' into develop

It's a git pull that merged origin/develop (remote changes) into develop (local changes) and we had a lot of problems because of those, loosing code and all.

So now our workflow prevent any problems with git pull merging and keep things simple. Basically it's like a rebase but by merging branch, easily doable in the most basic gui. Others changes are always merged into yours so in case of conflict you only fix what affect the lines you changed! And only your changes appear in the final commit.

  1. Checkout and pull develop
  2. Create a feature branch X from develop
  3. Do your work onto X
  4. To get possible incoming changes checkout and pull develop
  5. If there was remote changes merge develop onto X
  6. If there is conflicts resolve them
  7. If you did 5 or 6 then go back to 4
  8. Merge X onto develop
  9. Push develop

Yeah it look like a bit of a hassle, changing branch, pulling and all. But if you look at rebase doc, they warn against using it in shared branch. So you'll end up creating the same X branch then git fetch origin develop and git rebase origin/develop and you still need to merge that rebased X branch back onto the shared branch develop, so the same amount of work.

Normally if there was remote change at step 5 and specially if there was conflict at step 6. You need to test again and it take time, so that's why you go back to step 4. There is a race condition doing step 8 and 9, but it's really a corner case where someone else push right before you.

Related