It’s been a while, but I finally had some time to look further into this and try out your suggestion.
But I was not really satisfied with the end-result of bfg so I spend some time looking at other alternatives/suggestions of other people.
Tried out a few options, but in the end I settled for git-lfs-migrate.
The working solution is as followed (assuming git-lfs has been installed):
- git clone --mirror <your existing gitea git repo>
- cd <local directory of your cloned git repo>
- git lfs migrate import --everything --include=’<files/folders to migrate to LFS here>’
- git reflog expire --expire=now --all && git gc --prune=now --aggressive
At this point work is done locally. Now the push to gitea:
- !!!Backup database, gitea files etc in case something stuff up!!!
- Create a new repository in Gitea! (You get the ‘bad object’ error otherwise)
- git remote set-url origin <your new gitea repository url here>
- git push
And that’s it!
Thanx for your help @6543!