A message about initializing Git LFS (see below) comes up when using GitHub Desktop to clone a repository that has previously used Git LFS. How can I remove this message?
This repository uses Git LFS. To contribute to it, Git LFS must first be initialized. Would you like to do so now?
[path to repository]
For context, I would like to prevent this message from popping up as the repository has not used Git LFS in a long time.
What I've tried
-
The
exportmode migrates Git LFS pointer files present in the Git history out of Git LFS, converting them into their corresponding object files.This is the most promising because it seems to be the intended method. However, cloning the repository after following the steps below resulted in the same message being displayed.
git lfs migrate export --everything --include='*' git push --force --all git-lfs — Simple steps to uninstall Git LFS from your repository
The basic steps this solution are as follows:
git lfs uninstall- recommit lfs files to restore them
git lfs ls-files- For each files
git rm --cached myfile.psdgit add myfile.psd
- `git commit -m "restore files from lfs"
- remove lfs
.gitattributeentries
On step (2), running
git lfs ls-fileslists nothing. For step (3).gitattributesalready has nothing for Git LFS, so there is nothing to remove. In the end, no changes are made, and if I clone the repository again with GitHub desktop, the problem persists...-
Checking my tracked file sizes with
git ls-files | xargs du -shand deleting blobs above that size withbfg --strip-blobs-bigger-than [size] [your-repo].gitworks great except there is a large file in the project history that should remain tracked. This approach may work if there was a good way to exclude a file frombfg --strip-blobs-bigger-than. It's also not clear whether this would help remove the dependency on Git LFS.
