Easy automatic backups from logseq to github (or any git host) #5874
Replies: 4 comments 7 replies
-
|
Since I was stuck on this for a bit: just want to highlight that it's critical to use the SSH url when adding the remote (HTTPS does not work) |
Beta Was this translation helpful? Give feedback.
-
|
Is this still working? I'm doing this on windows and my post-commit hook works if I manually commit, but Logseq seems to be bypassing hooks when it auto commits. |
Beta Was this translation helpful? Give feedback.
-
|
I asked same question in the forum. https://discuss.logseq.com/t/post-commit-git-hook-is-not-triggered-by-logseq/28097/ |
Beta Was this translation helpful? Give feedback.
-
|
I've been using logseq-plugin-git with mostly success, it's simpler to setup, and when things break, there is less troubleshooting involved (at least for me) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If you turn on git commits, you can add a git hook to the repo that automatically pushes to your git remote host every time it commits!
The setup:
cdinto the folder that stores your logseq datals -al .gitshould list a.gitfile as existing by nowgit remote add origin <ssh path to your github repo>cat .gitwhich should print something like this (this is for iCloud, path will vary):gitdir: /Users/phoenix/.logseq/git/_Users_phoenix_Library_Mobile Documents_iCloud~com~logseq~logseq_Documents/.gitgit config core.hooksPath <path from prev command>/hooksto set the hooks path for the repo (may not be necessary on all machines, but was necessary on mine because I have a different global hooksPath)cdinto the directory that was in the.gitfile. Make sure to wrap the path in double quotes if it has spaces in it.git config init.defaultBranchto see the default branch namenano hooks/post-committo edit the post-commit hookmaster, replacemainwithmasterchmod +x hooks/post-committo make the file executableThat should be all! Now every time logseq does an auto-commit, it should automatically get pushed to your github repo.
Beta Was this translation helpful? Give feedback.
All reactions