A less expensive option then may be to start 301 redirecting your page to your original git repo idea and hope they stick around and they continue to allow free hosting. It might be worth reaching out to them and discussing your plans and get feedback from them. They might have long term plans to cease free hosting and may or may not share this plan. Consider appointing someone to maintain this setup in the event that the repo provider makes significant changes and expects the end-user to adapt.
Good idea, it seems that I can start a 301 redirecting before I die, If all goes well, search engines have a 10-year window to navigate to the new free hosting site.
I should add that when testing this setup, start with 302 temporary redirects in case there is a mistake. Once you are confident it is working as desired then switch to 301 permanent redirects. Double check things like your robots.txt and sitemap.xml/txt.