Git auto-sync/commit

HI all,
I am trying to get the Git plugin set up and running. it looks like it works fine when i run the command Git: sync, but trying to set the settings of

git:  
  autoCommitMinutes: 5  
  autoSync: true

in my SETTINGS file do not seem to be doing anything. I dont see any useful logs in the container relating to this. no indication that it is trying nor failing.

I did see someone suggest making a script-space to auto commit on save, which seems good enough, but they didnt share their code: Backup your space to Github - #4 by vuau

Any suggestions? Thanks!

Hope it helps

silverbullet.registerEventListener({name: "editor:pageSaved"}, async (event) => {
  // Clear the existing timeout if the function is called again before the delay
  if (debounceTimeout) {
    clearTimeout(debounceTimeout);
  }

  // Set a new timeout
  debounceTimeout = setTimeout(async () => {
    try {
      // Invoke the git sync command
      await system.invokeFunction("git.syncCommand");
      console.log("Git sync command executed successfully.");
    } catch (error) {
      console.error("Failed to execute Git sync command:", error);
    }
  }, 60000 * 5); // 5 minute delay
});
1 Like

Thanks! Good stop gap, although still curious why the plug isnt functioning correctly!

I did find that loading my plugs, i get the following error for each plug:

plugin failed Error: Unregistered syscall clientStore.get