Home > Mobile >  Should I migrate local history when switching to Git LFS after hundreds of commits?
Should I migrate local history when switching to Git LFS after hundreds of commits?

Time:03-28

I have a git repository (a Godot game project using GDScript) that I've been working on for quite a while and has about a thousand commits, pushed to GitHub.

I'm to start adding binary assets like image or sound files with Git LFS.

Looking at the git-lfs-migrate docs I should probably migrate the local history to have some already existing png files converted too. Now, this looks like a significant change and I don't insist on shooting myself in the foot, so I'd like to know what is the best practice for this type of repository migration.

I'm the only one working on this repository so even sacrileges like force pushing is acceptable to me, as long as I don't lose my code and can convert my large files.

Clarification: Primarily I'm unsure about the possible consequences of migrating the local history or going without rewriting local history. Not sure what's the pros and cons are for these choices.

The reason why I'm considering Git LFS is that so far I've only been editing text files, but now I'm about to add a number of large binaries (images, sounds, data files), which will change during development, so not using LFS would be a waste. Ideally I'd only like to download the latest binaries when I'm cloning the repository to my various test environments.

CodePudding user response:

Finally I did not migrate anything, just installed git-lfs, then pushed the changes to the remote repository on GitHub. When I cloned the repository on my 2 other computers (a Linux and a Mac), not forgetting to install git-lfs there too, on both cases I received a weird error, complaining about "smudge filter lfs failed".

This SO answer was the solution: https://stackoverflow.com/a/48882513/63377

Essentially LFS didn't have a URL set and it was too timid to tell me. I had to run git config lfs.url $(git config remote.WHATEVER-MY-LFS-REMOTE-NAME-IS.url), then do another git pull, and it all seems to be working.

  • Related