Skip to content

Instantly share code, notes, and snippets.

View TheDragonNidhogg's full-sized avatar

TheDragonNidhogg

View GitHub Profile
@everttrollip
everttrollip / remove-git-lfs.md
Last active March 13, 2024 08:46
Removing git lfs from (any) repository

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 git rm --cached for each file
    • if your list is big, copy the contents into a file.txt
  • make sure you remove the number and asterik on each line, you only want the paths to the files