I'd like to understand the following situation about my git repository.
I'm at commit XXX and I have a clean repos (nothing untracked/modified) aligned with the last commit on origin/develop.
My colleague has created and pushed with Visual Studio, a new commit YYY on top of the previous commit XXX containing among others a project.csproj file having 4 new lines.
Just after that I pulled from origin/develop and retrieved only the commit YYY.
Now, the project.csproj file and only this one appears modified and impossible to undo with git checkout project.csproj
.
The difference with the modified project.csproj and the one on the commit YYY is that mine (the modified) has 4 less lines.
My question is, since i have pulled the commit with those 4 new lines why they weren't took into account?
git clean, git reset, git clone
changed nothing.
If i git stash
the file project.csproj is copied to a new stash instead of being moved.
My colleague went back again to his VisualStudio and the project.csproj was surprisingly still modified with 4 new lines. He added the file to a commit ZZZ and pushed it to origin/develop.
When i pulled the commit ZZZ everything went back to normal, and project.csproj isn't anymore in modified status.
The SHA generated on project.csproj (in commit ZZZ and commit YYY) with
git ls-files -s project.csproj
after checking out is the same.
This situation is reproducible when I return to the commit YYY
Could someone clarify the situation?
Thank you in advance