1

We have a repository with multiple branches and merge commits. There was some disagreement at the start on whether we wanted to use LFS or not, and the result was that no files have yet been tracked with Git LFS. Now, however, we've run into issues and we would like to migrate the entire repository history, including all branches and merges, to use LFS for files specified in a new .gitattributes file. Note that this .gitattributes file is not part of the repository history.

So far, we've tried a few variations on git lfs migrate import --everything without success. When using the --fixup option, the history is rewritten but nothing gets tracked by LFS. Without that option, the migration modifies our .gitattributes file and adds EVERY file type in the repo, plain text files included. We haven't yet been able to get it to respect our .gitattributes the way it was written, without modification. We tried committing our .gitattributes before the migration as well as not committing it, and also explicitly running git lfs track before the migration as well as not doing that.

We've looked at existing SO questions, but none of the answers seem to match our situation. Here are some of the others that we looked at:

Any help is greatly appreciated. Thank you!

Postscript: We understand that we could probably use the --import option repeatedly to make migrate re-create the desired .gitattributes, but I'd love to know if this is doable without that.

Tientuinë
  • 205
  • 2
  • 7

1 Answers1

0

I am closing this out because we've realized that we misunderstood the use of option --fixup, and the reason it wasn't working when we tried moving our .gitattributes to the start of the history (with rebase) was because Git LFS was on during the rebase (leading to a "should have been pointers" error).

It's all pretty well covered here: https://github.com/git-lfs/git-lfs/issues/3543

We're just going to go ahead with multiple explicit --imports instead of --fixup. Thanks to anyone who read the original question and was considering a reply.

Tientuinë
  • 205
  • 2
  • 7