Home > front end >  LFS Object stuck in Git history
LFS Object stuck in Git history

Time:01-26

I am building a static website and tried to upload a large video file thanks to Git LFS, but the commit/push never succeeded. After some change I decided to not upload this file and wanted to uninstall LFS. Now the object keeps uploading every-time I try to push on Github and I can not push any update. When I type "git push origin main", the LFS object uploading starts. It looks like it is stuck in the Git History. I tried to delete the repo, create a new one and push again, but same problem.

Any idea on the process to fix this issue ?

Thanks a lot for your help,

I'm available if you need more details

CodePudding user response:

If, by pushing the same repository, the issue persists, check locally the content of that repository.

In particular, from "Simple steps to uninstall Git LFS from your repository", look for any .gitattributes file which would still have any LFS-related entry.

See also "Move Git LFS tracked files under regular Git"

git lfs untrack '<pattern>'
git add --renormalize .
git commit -m 'Restore file contents that were previously in LFS'

The OP hbonnaf adds in the comments:

I just used a radical solution that worked:

I fetched an old version of my code from my remote repo. T

CodePudding user response:

Thanks for your answer. However I tried and it didnt work. Nothing has never been pushed to remote repo as it always failed. In my local I don't have any .gitattributes file

I tried to follow the GLF cleaner process but it did not delete anything. I just do not know which process to follow to clean up this Git history...

  •  Tags:  
  • Related