Unstaged changes left after git reset --hard
发布时间:2020-12-14 16:37:38 所属栏目:百科 来源:网络整理
导读:一.问题描述 工作空间有两个文件,覆盖不掉。git reset --hard,git checkout -- file 都覆盖不掉。 $ git status On branch branch_NO17 Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..."
一.问题描述工作空间有两个文件,覆盖不掉。git reset --hard,git checkout -- file 都覆盖不掉。 $ git status 二.解决1.删掉.gitattributes文件 $ find . -name .gitattributes 2.将工作区所有添加到缓存区(包括对.gitattributes的删除) $ git add -A 3.强制覆盖缓存区和工作区 $ git reset --hard 4.查看工作区和暂存区的状态 $ git status 参考: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |