Logseq sync with 
Git and GitHub

Logseq sync with
Git and GitHub

r

參考文章:https://github.com/CharlesChiuGit/Logseq-Git-Sync-101

MacOS

MacOS

git

ssh key

r

$ ssh-keygen -t ed25519 -C "your_email@example.com"

a

ED25519

logseq-plugin-git

.git/hooks

post-commit

r

#!/bin/shgit push origin main

pre-commit

r

#!/bin/shoutput=$(git pull --no-rebase)if [ "$output" = "Already up to date." ]; then  # no ouput  exit 0else   echo "${output}"figit add -A

Android

Android

Termux

Termux

fromDriod

fromGoogle Play

Git

r

apt update apt upgradabe apt upgrade pkg install openssh pkg install git      

ssh key

r

$ ssh-keygen -t ed25519 -C "your_email@example.com"

a

ED25519

sh

pull.sh

r

#!/usr/bin/bashcd ~/storage/shared/Documents/<your repository name>git pull

push.sh

r

#!/usr/bin/bashsource bin/source-ssh-agentcd ~/storage/shared/Documents/<your repository name> git add -Agit commit -m "sync from android"git push

git download

clone

r

git clone git@github.com:{your-username}/{your-reponame}.git 

a

auto-syncing

install

cronie

termux-services

sv-enable crond

crontab -e

r

*/15 * * * * ~/sync_mylogseq.sh`#每15分鐘執行次。

create sync_mylogseq

r

#!/bin/bashcd ~/storage/shared/Documents/<your repository name>git add .git commit -m "Android Sync $(date)"git pullgit push

Windows

Windows

git

ssh key

r

$ ssh-keygen -t ed25519 -C "your_email@example.com"

a

ED25519

logseq-plugin-git

.git/hooks

post-commit

r

#!/bin/shgit push origin main

pre-commit

r

#!/bin/shoutput=$(git pull --no-rebase)if [ "$output" = "Already up to date." ]; then  # no ouput  exit 0else   echo "${output}"figit add -A

Linux

Linux

git

ssh key

r

$ ssh-keygen -t ed25519 -C "your_email@example.com"

a

ED25519

logseq-plugin-git

.git/hooks

post-commit

r

#!/bin/shgit push origin main

pre-commit

r

#!/bin/shoutput=$(git pull --no-rebase)if [ "$output" = "Already up to date." ]; then  # no ouput  exit 0else   echo "${output}"figit add -A

iOS

iOS

Working copy

Working copy

Shortcuts

Shortcuts