Git: cannot do a partial commit during a merge (SourceTree)

After updating the SourceTree to it’s latest version I am fighting with this issue. Assume following scenario:

There are file A, B and C under the version control and there is just one branch. In my working copy, I make some changes to the file A so it turns into a A’ as well as the file B to B’. Someone else in his working copy makes a change to the file C -> C’.

  • Stash the changes made with atlassian sourcetree
  • How to create tag automatically in SourceTree
  • How to logout / switch accounts in Sourcetree
  • SourceTree keeps asking for Github password
  • SourceTree 1.6.14 cannot find Git 2.4.0 installation on Windows
  • git - apply a commit on another branch to the working copy
  • I stage and commit my changes to the file B only. So I have a new revision: A, B’, C and working copy A’, B’, C.

    The other one commits his changes, so he makes a revision A, B, C’ and pushes it to the origin.

    And here it comes. When I perform the pull, I get some merge changes (the C’). And I want to commit a revision consisting of A, B’, C’. I do not want to do now anything with the modified file A. However, the GIT, SourceTree resp., fails with:

    fatal: cannot do a partial commit during a merge.

    untill I stage or discard changes to the file A.

    I am pretty sure the some previous version of SourceTree did not expose this behavior.

    Update 2017/05

    It appears in the most recent SourceTree version this issue has been resolved. However, be sure you want to update to this version, because it contains lot of “bugs” (new features) I really dislike.

  • SSH - Permission denied (cannot authenticate via CMD
  • Git: possible to make a branch into the master, ignoring any merge conflicts?
  • Access Git Repository using Eclipse and Netbeans Plugins with LDAP Users
  • Git: Determining merge changes when no conflicts
  • Git timeout on Qt Creator
  • git push rejected: error: failed to push some refs
  • One Solution collect form web for “Git: cannot do a partial commit during a merge (SourceTree)”

    fatal: cannot do a partial commit during a merge.

    This indicates that your merge is still in progress, there could be some conflicts which you still need to resolve.

    Please select Conflicts from the drop down box as screenshot and you should be able to see a list of conflicted files with a triangle icon. Resolving these and then doing a commit should fix your problem.

    enter image description here

    This post should give a brief idea of how to configure and use an external tool to resolve merge conflicts – How to interactively (visually) resolve conflicts in SourceTree / git

    If you still can’t make up, you may stash your changes. Pull from origin and apply stash to fix the same.


    You can also automate all such operations using “custom action”. One sample script to do a stash >> pull >> apply stash is copied below

    git -c diff.mnemonicprefix=false -c core.quotepath=false stash save temp
    git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
    git -c diff.mnemonicprefix=false -c core.quotepath=false pull origin <<local path goes here>>
    git -c diff.mnemonicprefix=false -c core.quotepath=false submodule update --init --recursive
    git -c diff.mnemonicprefix=false -c core.quotepath=false stash apply stash@{0}
    Git Baby is a git and github fan, let's start git clone.