V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
yazoox
V2EX  ›  git

怎么处理 git 下面 lfs 文件“坏掉”的问题?现在没办法 checkout branch 了

  •  
  •   yazoox · 2020-06-22 09:56:52 +08:00 · 4268 次点击
    这是一个创建于 1376 天前的主题,其中的信息可能已经有所发展或是发生改变。
    $ git checkout docs\splash.png
    Updated 1 path from the index
    Encountered 1 file(s) that should have been pointers, but weren't:
            docs/splash.png
    

    如上所示,git repo 里面的图片文件 ,被人全放到 lfs 里面去了。结果今天发现,有些文件出了点问题。比如:

    splash.png 文件,我明明没有修改,却变成了“修改状态。然后我 checkout 也不行,怎么都不处理不了。google 了半天,也搞不定。

    大家有碰到过这样的情况么?怎么解决的?

    p.s. 难道只能把本地的 git repo 删除了,重新 git clone 下来?

    1 条回复    2020-06-22 10:19:43 +08:00
    yazoox
        1
    yazoox  
    OP
       2020-06-22 10:19:43 +08:00
    I resolved the issue by running the following commands. (p.s. my system is windows 10)
    ```
    git rm .gitattributes
    git reset --hard HEAD
    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2814 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 14:38 · PVG 22:38 · LAX 07:38 · JFK 10:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.