I wrote a how-to guide on pushing from 1Writer to a remote Git repository. It includes the JavaScript I use for the action.