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

2020-06-22 09:56:52 +08:00
 yazoox
$ 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 下来?

4304 次点击
所在节点    git
1 条回复
yazoox
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
```

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/683636

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX