Skip to content

Instantly share code, notes, and snippets.

@Jakiboy
Created August 21, 2025 21:43
Show Gist options
  • Save Jakiboy/92cb7a3eeaab30d07e560047f1ea4edc to your computer and use it in GitHub Desktop.
Save Jakiboy/92cb7a3eeaab30d07e560047f1ea4edc to your computer and use it in GitHub Desktop.
Removing Git LFS (GitHub)

Removing Git LFS (GitHub)

Remove Git LFS from the repository and restore image files (e.g., PNGs).

1- Stop tracking files

git lfs untrack *.png # Or any other format

2- Converts LFS files into regular objects

git lfs migrate export --everything --include="*"

3- Uninstall LFS

git lfs uninstall

4- Remove LFS entries from .gitattributes and global .gitconfig

nano .gitattributes
git config --global --edit

5- Update the repository

git add .gitattributes
git commit -m "Remove Git LFS"
git push origin main --force # Should be forced, branche 'main'

6- Fix images

If you are using a custom folder (e.g., /custom) for images, rename it to /assets,
Fix images headers using an image editor (e.g., Photoshop), and overwrite existing files.

git add *.png # Or any other format
git commit -m "Fix images headers"
git push origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment