Remove Git LFS¶
Services such as GitHub offer Git LFS for their repositories, but these may not exceed the additional storage of 1 GiB. Purchasing additional quotas from GitHub is then quite expensive.
See also
But how do you get rid of Git LFS in such a repository?
The following steps allow you to get rid of Git LFS:
Use
git lfs ls-files
to get a list of all files managed by Git LFS.Next, we make sure that we have checked out all large files with
$ git lfs fetch --all $ git lfs checkout
Remove the Git LFS filters:
To do this, you must first remove entries such as :
*.png filter=lfs diff=lfs merge=lfs -text
from your.gitattributes
file.You can then stop Git tracking for each deleted entry in the
.gitattributes
file, for example withgit lfs untrack '*.png'
.Alternatively, you can also use
cut -f 1 < .gitattributes | xargs "git lfs untrack {}"
for all files managed with Git LFS.Finally, the line ends should be normalised with
git add --renormalize .
.
Now Git LFS can be uninstalled with
git lfs uninstall
.Finally, the changes must be transferred to the server.
Now you can switch to Manage data with DVC, for example, to manage large files in a versioned manner.