Search code examples
gitversion-controldevopsatlassian-sourcetree

Git does not produce a new commit when merging A->B then B->A, how do I make sure other teams see the second merge?


Git does not produce a new commit when merging A->B then B->A, how do I make sure other teams see the second merge?
I merged A->B to pull in latest from other devs so that QA can test with my changes plus all others also. Now I need B->A to push the main branch to remote with my changes. This second merge does not produce a new commit. It may update history but no new commit. So to other devs it looks like nothing happened. Also using sourcetree gui for git does not issue a notification as it usualy would when it detects new commits have been pushed to remote. What are my options for a new commit? Obviously adding a line to some random file is an option but is also an annoying addition to the process. Thanks in advance for advice.


Solution

  • You don't get a merge commit because this is a fast-forward update.

    You can force creating the merge commit on fast-forward updates with the --no-ff option.

    git help merge will give you more details.