V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
forgottencoast
V2EX  ›  程序员

为什么git reset --hard无法重置工作区的若干个文件?

  •  
  •   forgottencoast · 2013-11-23 17:08:36 +08:00 · 6615 次点击
    这是一个创建于 3798 天前的主题,其中的信息可能已经有所发展或是发生改变。
    git checkout也不行,总有3个文件没有被还原。
    这3哥文件已跟踪,git status -s显示第二列M。
    第 1 条附言  ·  2013-11-23 19:21:37 +08:00
    问题解决,参见:http://stackoverflow.com/questions/11383094/unstaged-changes-left-after-git-reset-hard
    3 条回复    2019-11-16 23:37:41 +08:00
    4code1
        1
    4code1  
       2013-11-24 11:41:43 +08:00
    试试 git clean -dxf
    msg7086
        2
    msg7086  
       2013-11-24 12:33:24 +08:00
    多数就是行尾cr/lf的问题。其实diff一下就知道问题在哪了
    chengcheng222e
        3
    chengcheng222e  
       2019-11-16 23:37:41 +08:00
    git config core.filemode false 这个搞定
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2814 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:20 · PVG 08:20 · LAX 17:20 · JFK 20:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.