Categorie: Tutti - android - windows - sync

da 林 光章 mancano 7 mesi

493

Logseq sync with Git and GitHub

Synchronizing Logseq with Git and GitHub involves setting up various scripts and configurations across different operating systems like iOS, Android, MacOS, Windows, and Linux. The process includes generating SSH keys to secure connections, using Git commands to pull, add, commit, and push changes, and automating these tasks with scripts and cron jobs.

Logseq sync with 
Git and GitHub

Logseq sync with Git and GitHub

參考文章:


iOS

Shortcuts
Working copy

Linux

Windows

Android

auto-syncing
create sync_mylogseq

#!/bin/bash

cd ~/storage/shared/Documents/<your repository name>

git add .

git commit -m "Android Sync $(date)"

git pull

git push

crontab -e

*/15 * * * * ~/sync_mylogseq.sh`

#每15分鐘執行次。


sv-enable crond
install

termux-services

cronie

git download
clone

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

sh
push.sh

#!/usr/bin/bash

source bin/source-ssh-agent

cd ~/storage/shared/Documents/<your repository name> 

git add -A

git commit -m "sync from android"

git push

pull.sh

#!/usr/bin/bash

cd ~/storage/shared/Documents/<your repository name>

git pull


ssh key
Git

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


Termux
fromGoogle Play
fromDriod

MacOS

.git/hooks
pre-commit

#!/bin/sh


output=$(git pull --no-rebase)


if [ "$output" = "Already up to date." ]; then

  # no ouput

  exit 0

else 

  echo "${output}"

fi


git add -A

post-commit

#!/bin/sh

git push origin main

logseq-plugin-git
ssh key

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

ED25519
git