Sourcetree adding uncommitted changes after switching branch

Hi all,

I have noticed a problem this morning when switching branches.

After having committed ALL my changes in branch A I have switched to branch B and done a pull and a lot of changes came in.

When I switched back to A, Sourcetree showed me a lot of uncommitted changes which I think were the changes that came in from the pull in branch B.

I basically have a similar or same problem mentioned in

However nobody has answered that question.

Why does this happen? This is an error. I shouldn't be seeing all these changes from a separated branch.

I had to discard all these changes before being able to do anything else. But I can't really do this every time I switch branch.

Please let me know why this happens and how to fix it.



6 answers

Me too, I have had the same problem – thought it was me since I'm new to Sourcetree. What is happening? Why no word from the developers on this or the other thread?

I'm not able to reproduce your issue. Can u make sure Branch B is not merged with Branch A before you did pull request. Also make sure you don't have any server hook or stash which automatically merge branches

I can confirm I also am having the same problem.  The pattern seems to be the following:

  1. Branch off master to a new unpublished branch
  2. Commit changes to the new branch (e.g. develop); do not push changes
  3. Switch back to master
  4. Master now shows uncommitted changes as "unstaged files."

It seems odd that SourceTree shows the files from the previous commit from a different branch as unstaged uncommitted changes.  Worse, while it is SourceTree that checks out the files, it will not undo the changes either. 

Tools that hook into Git such as Visual Studio do not show this nor do they present the files as uncommitted until I open SourceTree.

I'm having the same **** problem. It seems like if I have more then one file to commit and push then switch to another branch this branch has all the uncommitted changes from the branch I just pushed. I have to discard all changes then do my merge. AHHHHH!

I'm having the same problem, but each time that i change of branch and pull, when i back to my old branch it shows a lot of unstaged files. It's killing the productivity, because i lose a lot of time to check all the files before to discard or merge. I love sourcetree, but became so hard to work with it that i'm stopping to using it. Now i'm doing all in the terminal, with commands, is not confortable but is safe. I will keep like this until some solution show up.

Same problem today, my collegue followed this pattern:

  • new branch from development branch
  • modified x files
  • commit changes to the new branch and push them
  • switch back to development
  • Sourcetree list the previous changed files as unstaged


This is a big issue.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

706 views 0 4
Read article

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot