Easy automatic backups from logseq to github (or any git host) #5874
Unanswered
phoenixeliot
asked this question in
Show and tell
Replies: 1 comment 1 reply
-
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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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:
cd
into the folder that stores your logseq datals -al .git
should list a.git
file as existing by nowgit remote add origin <ssh path to your github repo>
cat .git
which 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/.git
git config core.hooksPath <path from prev command>/hooks
to 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)cd
into the directory that was in the.git
file. Make sure to wrap the path in double quotes if it has spaces in it.git config init.defaultBranch
to see the default branch namenano hooks/post-commit
to edit the post-commit hookmaster
, replacemain
withmaster
chmod +x hooks/post-commit
to 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