Search code examples
gitcloneadditioncommitgit-checkout

git checkout causes modified file which cannot be added


I git clone my repo and git status shows everything is fine (for want of a better expression) aka no changes, etc.

I then git checkout a feature branch and git status shows one file (which exists in both master and the feature branch) to be modified.

git add . does absolutely nothing to change the git status and I have not made any changes to the file during the process above.

The file is not git ignored.

[UPDATE]

I tried git add <filename> and the git status has changed from modified conflicted to modified modified, as represented by the posh git statuses:

modified conflicted +0 ~1 -0 !
modified modified +0 ~1 -0 ~

What I don't understand is how to resolve this. git add ., git commit and git push --force do nothing to the status.


Solution

  • It turns out that one person had committed a file with the filename NuGet.config on master and another had committed the same file with the filename NuGet.Config. I have resolved the conflict on the remote repo browser and all is well.