Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming a merge with Sourcetree

Using Sourcetree, I'm wondering if there is a way for naming merge (as it is possible to do on GitHub for example) to avoid having very many occurrences of the same:

Merge branch 'feature' into master

The documentation, last modified on Sep 37 (sic), 2016, seems quite silent on this possibility.

like image 652
P. Mergey Avatar asked Sep 15 '17 20:09

P. Mergey


People also ask

How do I set the merge tool in Sourcetree?

SourceTree config First, open up the options window and go to Diff tab. Change both External Diff Tool and Merge Tool to Custom. In the Diff Command field enter the full path to the vsdiffmerge.exe. For VS 2015 and below you can find it in the Visual Studio installation folder, under Common7\IDE subfolder.

Why you should rebase instead of merge?

But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch. The major benefit of rebasing is that you get a much cleaner project history. First, it eliminates the unnecessary merge commits required by git merge .

How do you merge without fast-forward in Sourcetree?

There is a "Do not fast-forward when merging, always create commit" option in preferences. Note that the Windows version of SourceTree actually provides this option right in the merge dialog.

How do I create a git merge?

Use git-reset or git merge --abort to cancel a merge that had conflicts. Please note that all the changes will be reset, and this operation cannot be reverted, so make sure to commit or git-stash all your changes before you start a merge.


1 Answers

To create a commit message for a merge in source tree, you can perform the merge and commit separately.

First, select the commit you want to merge and choose Repository > Merge... from the menu.

In the resulting dialog:

  1. Ensure that Commit merge immediately (if no conflicts) is not checked
  2. Click OK

enter image description here

Resolve any conflicts if necessary, then you'll complete the commit on the merge:

  1. Click Commit in the ribbon
  2. Enter your desired commit message
  3. Click Commit

enter image description here

Of course, if you're feeling more adventurous, the fastest way to do this is to open the terminal and use the merge command with a message specified:

For a short message
git merge -m "Your message" <branch>

For a longer message (opens your default editor)
git merge --edit <branch>

like image 170
LightBender Avatar answered Oct 13 '22 21:10

LightBender