{"repo":"tiddly-gittly/git-sync-js","free":true,"listed":false,"github":"https://github.com/tiddly-gittly/git-sync-js","clone":"git clone https://github.com/tiddly-gittly/git-sync-js.git","description":"JS implementation for Git-Sync, a script that backup notes in git repo to the remote.","language":"TypeScript","stars":26,"topics":["git-sync","git","note-taking","backup-script","backup","obsidian","sync","tiddlywiki"],"license":"MIT","category":"productivity","readme_excerpt":"git-sync-js Documentation Site JS implementation for Git-Sync, a handy script that backup your notes in a git repo to the remote git services. Used by OpenSource free bi-link second brain note taking & knowledge map app TidGi-Desktop, refactor out to be a npm package. Major Functions There are three major functions: initGit, clone, commitAndSync , but you may import other helper functions and Error types, and GitStep types: See api docs for full list of them. You can see TidGi-Desktop's usage for full example. initGit initGit() Initialize a new .git on a folder. If set syncImmediately to true , it will push local git to remote immediately after init, you should provide userInfo.accessToken and remoteUrl , otherwise they are optional. commitAndSync commitAndSync() is the Core feature of git-sync, commit all unstaged files, and try rebase on remote, and push to the remote. clone clone() will Clone a remote repo to a local location. Inspect helpers getModifiedFileList Get modified files and modify type in a folder getDefaultBranchName getSyncState assumeSync getGitRepositoryState getGitDirectory hasGit Check if dir has .git . Sync helpers commitFiles continueRebase Steps These is a git sync steps enum GitStep, that will log to logger when steps happened. You can write switch case on them in your custom logger, and translate them into user readable info. Errors These are the errors like AssumeSyncError that will throw on git sync gets into fatal situations. You can try catch on m","default_branch":null,"files":null,"tree":[],"storefront":"/r/tiddly-gittly","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tiddly-gittly/git-sync-js/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}