Skip to content

Instantly share code, notes, and snippets.

@AHS12
Last active October 5, 2021 21:15
Show Gist options
  • Select an option

  • Save AHS12/98caa24eedcfae9332b21c3bfdce194c to your computer and use it in GitHub Desktop.

Select an option

Save AHS12/98caa24eedcfae9332b21c3bfdce194c to your computer and use it in GitHub Desktop.
Remove Git Lfs

So, it has been an interesting journey, but time to remove git-lfs. Here follows a summary of the approach I used to safely remove git-lfs,

  • commit & push everything
  • create a branch, something like fix/remove-lfs
  • remove hooks git lfs uninstall
  • remove lfs stuff from .gitattributes (open file, delete content - don't delete the file!)
  • list all lfs files, git lfs ls-files
  • run the commands

git lfs untrack '<pattern>' (in my case, all files "*.*")

git add --renormalize .

git commit -m 'Restore file contents that were previously in LFS'

  • run a git status and make sure all the files were added properly
  • commit everything
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment