git checkout导致修改后的文件无法添加 [英] git checkout causes modified file which cannot be added
问题描述
我的 git克隆
我的仓库和 git的状态
显示一切都很好(因为需要更好的表达)没有更改等。
I git clone
my repo and git status
shows everything is fine (for want of a better expression) aka no changes, etc.
然后我 git checkout
一个功能分支和 git status
显示一个文件(同时存在于master和Feature分支中)。
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。
绝对没有改变 git状态
的功能,在此期间我没有对文件进行任何更改
git add .
does absolutely nothing to change the git status
and I have not made any changes to the file during the process above.
不会忽略该文件。
[UPDATE]
我尝试了 git add< filename>
和 git状态
已从已修改的冲突更改为已修改的修改,如豪华的git状态所示:
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 ~
我不明白的是解决这个问题。 git add。
, git commit
和 git push --force
不执行任何操作。
What I don't understand is how to resolve this. git add .
, git commit
and git push --force
do nothing to the status.
推荐答案
事实证明,一个人提交了文件名为 NuGet.config
和另一个已提交了文件名为 NuGet.Config
的相同文件。我已经解决了远程回购浏览器上的冲突,一切都很好。
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.
这篇关于git checkout导致修改后的文件无法添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!