Git merge without auto commit

Note the output while doing the merge – it is saying Fast Forward

In such situations, you want to do:

git merge <name-of-branch> --no-commit --no-ff

Important: If you do it this way, then you are not able to do any changes to the files in the staging area e.g. you can’t remove/add files or make any changes to the files.

If you want to merge the changes and then commit as if you had manually typed all of the changes you merged in (as opposed to a traditional merge) you need to run rm .git/MERGE_HEAD afterward, which will force git to forget that the merge happened.

Leave a Comment