在git重置后——很难,git状态给了我在Changes not staging for commit:部分中的文件。
我也试过git reset ., git checkout。而git check - out-index -f -a,毫无用处。
那么,我怎样才能摆脱这些未分阶段的变化呢?
这似乎只影响Visual Studio项目文件。奇怪。请看这个粘贴:http://pastebin.com/eFZwPn9Z。这些文件的特殊之处在于,在.gitattributes中我有:
*.sln eol=crlf
*.vcproj eol=crlf
*.vcxproj* eol=crlf
另外,在我的全局.gitconfig中,selflf被设置为false。这有什么关系吗?
我遇到的另一种可能性是,存储库中的一个包最终具有分离的HEAD。如果这里的答案都没有帮助,你遇到了这样的git状态消息,你可能有同样的问题:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: path/to/package (new commits)
进入路径/to/package文件夹,git状态应该产生以下结果:
HEAD detached at 7515f05
下面的命令应该修复这个问题,master应该被你的本地分支替换:
git checkout master
您将得到一条消息,您的本地分支将在远程分支后面提交一些数量的文件。快点拉,你应该脱离险境了!