Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git migrate from LFS to normal repo

There is LFS git repository hosted at Bitbucket server. Now we do not need LFS.

How to migrate from git LFS repository back to normal repository?

If repo with LFS - there are "pointers" instead of files in the commits. And if I need to remove LFS - I should use files instead of "pointers". So how replace all "pointers" with files in commit history?

Suggest, that it is something like git lfs smudge but should be applied for all log.

like image 299
tuchk4 Avatar asked Nov 01 '16 17:11

tuchk4


People also ask

How do I remove LFS from repository?

If you wish to delete the LFS file in your repository, navigate to the Repository settings > Git LFS and click the "..." drop-down on the right side of the files, then click Delete files. I hope this helps.

What is migrate LFS git?

gitattributes files, the git lfs migrate command will examine, create, and modify . gitattributes files as necessary. The . gitattributes files will always be assigned the default read/write permissions mode (i.e., without execute permissions).


1 Answers

I came across this issue today when I didn't want to use LFS anymore for a project on github.

To get information about the entire repository, you do:

git lfs migrate info --everything

Then, when you decide what you want to migrate, you use:

git lfs migrate export --everything --include="*.png, *.unity, *.hdr, *.clip, ArtifactDB"

Where --everything means all branches and in the --include option you list the file types you wish to migrate.

Important: This will rewrite all history and potentially you will have to either overwrite remote with --force or copy the new repo into some other server.

like image 124
Hangarter Avatar answered Oct 07 '22 20:10

Hangarter