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.
2015-05-09_08-21-51.png
Git status shows what I expected
2015-05-09_08-22-53.png
Thanks
Matt
Johannes,
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.
thanks
Matt
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 ...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ,,,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.