Sometimes when I merge a branch into master the files automatically commit themselves ready for a push. Typically I would expect a merge to first appear in the Working Copy area so I can review which files I do actually want to commit or remove.
Am I performing the merge incorrectly? While I'm in the Master branch I right-click on the branch to merge in then click "Merge branch into master".
Confusingly this problem only happens some of the time. On occasion the files do appear in the Working Copy area as expected.
Any suggestions welcome!
This happens because it is the way Git is designed to operate. The occasions when the files do NOT automatically commit are almost always because there is a conflict that needs resolved before you can commit.
There is good news, though. The fact that the merge is committed does not, in any way, prevent you from reviewing and modifying the changes. Review the diffs in the commit details, make any changes you need to make. Then, when you commit, select "amend previous commit".
Ok, thanks that makes sense. One other question though - when it auto-commits it doesn't give me a chance to add a log message. For example, if I merge from branchA into master I'd like to add "Merge 'branchA' into Master". Instead what actually happens is it uses the last commit message from that branch.
From what you've suggest it sounds like I could do an "amend previous commit" and add the message there, but it seems like an extra unneccessary step, especially if I don't have any further actual file amendments?
Hope this makes sense .. ?
When the merge comfirmation dialog opens, there is an option to "Create a new commit even if a fast forward is possible" - try that.
What is probably happening is that no changes were made to master between when you created your branch and when you merged it back. In that scenario, there isn't actually anything to merge, so by default git will instead "fast-forward" the master branch to the last commit on branchA. The option I mentioned will force git to create a new commit anyway (which is often preferred when dealing with a "master" or "dev" branch).
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot