Developing a large BASIC project. How can I use git for saving source code?

I am converting a large BASIC project from VB6 to LibreOffice.
How can I use git to save and restore source code as development progresses.
The project involves reading data from Calc and creating a Write document.
I need to know where the BASIC macro code resides and when it is saved from the document.

You can export as *.bas file with File → Export to BASIC…

Or you save the document as .ods or .odt and extract the Basic/ folder from the resulting zip file into a git repository. The files are XML streams though and not directly usable as runnable BASIC.
To update the document with such basic scripts from another git revision freshen (!) the .ods zip with the Basic/ files, i.e. use

zip -fr filename.ods Basic/

You could also save the document as flat .fods or .fodt, which produces one uncompressed XML file of the entire document, and have that in git.