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
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 ,,,
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 ...)
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG