SourceTree File Status

Is this a FAQ for the file statuses in SourceTree? I have a file that shows up in Staged as well as Unstaged, with the one in the latter with the "Clean" status. What does that mean?

I got here after doing a soft reset.



Git status shows what I expected






3 answers

This is a feature of git. You probably came into this situation by editing the file AFTER you staged it.

Staging takes a snapshot of the current file and puts it into the "staging area" (aka Index). If you edit your file after staging it, the snapshot within your working directory differs from the snapshot within the index (and the snapshot within index differs from snapshot in your repository). If you add your file again to the index (via git add), the situation changes: the snapshot in your working directory and the index are the same again - and you will only see the file in the staging area.

For more detailed information you might take a look for example here

This feature can be used for example to "git add" several changes of your file to the index (and to commit those changes) while ommitting other changes from the commit ,,,

Actually, it looks like you have the SourceTree filter set to All Files (I typically use Pending). The All Files filter will show all files, regardless of status, in the unstaged pane.


No I did not edit the file after staging it. I started off with a clean index and working directory, then I did 

git reset --soft HEAD~2

to arrive at what you saw (see Git Reset). I did not modify the file afterwards, index and working directory are the same.

You can see that git on the command line is reporting what we think correctly, but SourceTree is showing a "clean" file.

Seth, you are right, I had my filter set to All. I guess to SourceTree, clean means working directory is the same as index. I thought it might have been something related to reset. 



Ooops ... should have read the question more detailed ... I think your guess is right: git is already "aware" of your previous changes, as you staged your changes already. Therefore the state of your file in your working directory is clean (as your changes are already delivered to the staging area, where your file is stated as modified ...)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

981 views 4 2
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