git checkout causes modified file which cannot be added

只愿长相守 提交于 2019-12-13 03:23:48

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/52053462/git-checkout-causes-modified-file-which-cannot-be-added

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!