Reverse Merge Sourcetree

  • Status:Future Consideration(View Workflow)
  • Fix Version/s:3.2.4
  • Labels:
  1. Reverse Merge Commit Sourcetree
  2. Sourcetree Reverse Merge
  3. Sourcetree Revert To Previous Commit
  4. Sourcetree Undo Merge
  5. Remove Commit Sourcetree
Reverse
  1. Sourcetree will look slightly different based on whether you have a Git or Mercurial repository. If you have a Git repository, you are done. If you have a Mercurial repository, you will notice that you need to commit your changes. Click the Commit button at the top. The commit message defaults to a description with 'Merge.'
  2. After that, to check the status, you can use: git status. Repeat the same for the other commits you want to revert back: git revert — — no — commit c3714454fed. Then on the Sourcetree, you will see a new commit emerged, ready to be pushed. In this step, if you face conflicts, you must solve them before pushing.

Click Show to expand the list of branches. Under Branches, double-click the feature branch that is behind to switch to that branch. Click the Merge button. From the popup that appears, select the commit you want to merge into your feature branch. Check the Create a commit even if merge resolved via fast-forward option at the bottom. Merge file changes from a branch First, you want to switch back to the main branch. From the left-side menu items in Sourcetree, hover your mouse over. When Show appears, click it. Under the Branches heading, you will see the two branches for this repository, the main. Double-click the main.

  • Feedback Policy:

    Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

When trying to cherry-pick or revert a merge-commit (ie. the summed up result of everything that happened in a feature branch/pull request, which is pretty much the only kind of commit we would like to cherry-pick/revert), SourceTree gives an error message like this:

error: Commit 5c2ce83708a98b60d7d8f1bbaa1e4053372a6dac is a merge but no -m option was given.
fatal: cherry-pick failed

Please add support for cherry-picking/reverting merge commits.

Votes:
85Vote for this issue
Watchers:
39Start watching this issue

This article was updated for Visual Studio 2017.

Today, a short note on how to set up Visual Studio as a diif and merge tool in SourceTree and Git client. It’s not commonly known that this IDE may be used for resolving merge conflicts, but as you’ll see it’s very simple to set up.

SourceTree config

Reverse Merge Commit Sourcetree

Pdf

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 Common7IDE subfolder. Visual Studio 2017 has it slightly more hidden. Look under Common7IDECommonExtensionsMicrosoftTeamFoundationTeam Explorer.

Sourcetree Reverse Merge

Reverse Merge Sourcetree

As for the arguments fields, type in the following:

Diff tool: '$LOCAL' '$REMOTE' 'Source' 'Target' //t
Merge tool: '$LOCAL' '$REMOTE' '$BASE' '$MERGED' //m

Click OK, and And that’s it! Now whenever a merge conflict occurs, you’ll be able to resolve it using Visual Studio.

The only downside I found is that vsdifftool may take quite some time to start up. But if you don’t close it after diffing each file, it’ll work like a charm.

Commandline Git config

By saving these settings in SourceTree, your .gitconfig file is updated with two entries: [difftool “sourcetree”] and [mergetool “sourcetree”]. In my case it looks like the following:

Sourcetree Revert To Previous Commit

Reverse merge sourcetree software