git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
yazoox
V2EX  ›  git

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

  •  
  •   yazoox · Jun 22, 2020 · 5039 views
    This topic created in 2156 days ago, the information mentioned may be changed or developed.
    $ 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 replies    2020-06-22 10:19:43 +08:00
    yazoox
        1
    yazoox  
    OP
       Jun 22, 2020
    I resolved the issue by running the following commands. (p.s. my system is windows 10)
    ```
    git rm .gitattributes
    git reset --hard HEAD
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3004 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:52 · PVG 20:52 · LAX 05:52 · JFK 08:52
    ♥ Do have faith in what you're doing.