I need some help for moving from renkulab v1 to v2; in particular because of git LFS files on v1.
I cannot push my LFS files to github or other external provider, it’s too large.
How I envision is that
I need to pull git + git LFS to my laptop
convert all LFS tracked files to regular files (I don’t stress about history of the LFS files, only the latest version matter).
Remove those LFS files from all git commit history.
Push this new history to github.
Figure out the repo I broke with LFS files with Zenodo or etc. in some distant future.
Upon asking some chat bot, it looks more risky and less straightforward, and I am now wondering if my only trivial option without dedicating major time on this is to get the latest snapshot, remove LFS files, delete git history and do a init push on the remote provider.
Can someone create a step by step guide on how I should best proceed if keeping commit history without LFS is possible?
If it is indeed not something one cannot automate, please also let me know so I go with option B (no git history).
This will remove the lfs files from all history - and the last command will push the changes to the remote called origin. So the file will be completely gone (locally and in the remote repo) and wont be stored in git or lfs.
You can also do the following if you want to remove the LFS tracking of those files you removed:
Also if you want to start a new repo without the history the easiest way is to just start a brand new empty repo on github for example. Copy over the files you want to have in the new repo and commit and push them.
There are a lot of unwanted lfs files and since there are also a lot of repos to move in short time, I did not want to manually go over this list for the git filter-repo --path unwanted_lfs_file --invert-paths --all command.
I suppose if SDSC gitlab does not work, I will use git lfs ls-files --all --name-only to delete lfs files (or references), copy them to a new repo and have a hello world commit for all projects
One final comment.
It seems I need to do all this manually, but what would have saved me a good hour if not multiple hours would be to have Download my repos on renku gitlab button that does something like what I am doing now:
In GitLab, you can create an access token for the read_api scope and then make a call to list all your projects and iterate over that list, invoking the script you define above.