I'm using Git to manage a small game game project using Unreal4. We are using Git LFS but git is now accusing certain files of being changed even when no one altered them. This is causing some conflicts in PRs
This is an example of such a file
It's a .uasset file and the only change that it appears is a deleted line. However I did not change this file (nor did I opened it) and discarding these changes has no effect.
Thanks in advance
CodePudding user response:
If an LFS file's timestamp is updated, Git will cause it to be run through the clean filter when you next run git status
, which turns it into a pointer file in the repository. In your case, the pointer file that already exists is broken: it contains a blank line, and that isn't valid.
The best thing to do is to run git add --renormalize .
to fix all of these broken files and then commit. You should also find the tool that's creating these broken pointer files and fix or remove it. Once you've done that, you can proceed with your changes as normal.
Note that ignoring this problem is not going to make it go away, nor is git reset --hard
. Because of the way Git works with smudge and clean filters like Git LFS, your only option is to fix the changes and commit.