Skip to content

pihalf/gitseq

Repository files navigation

gitseq logo

GitSeq

Encrypted git sync for Logseq. One keystroke to commit & push.


Install

Search "GitSeq" in the Logseq plugin marketplace (Plugins > Marketplace) and click Install.

Manual install (from source)
git clone https://github.com/pihalf/gitseq.git
cd logseq-plugin-git-sync
npm install && npx vite build

In Logseq: Settings > Advanced > Developer mode (on) → Plugins > Load unpacked → select the dist/ folder.

Prerequisites

Before using gitseq, your Logseq graph needs to be a git repo with a remote:

cd ~/Documents/my-graph
git init && git branch -M main
git add -A && git commit -m "Initial commit"
gh repo create my-graph --private --source=. --push

See the full setup guide below for .gitignore templates and encryption.

Usage

Cmd+S to sync

Press Cmd+S (macOS) / Ctrl+S (Windows/Linux) to run a full sync:

  1. Flush pending Logseq edits to disk
  2. git add -A + git commit
  3. git pull --rebase — so edits from your other machines land before you push
  4. git push

The same pipeline runs on startup, on close, and on the periodic timer, so every machine converges every time you sync. If you're offline, your notes are still committed locally and pushed on the next sync.

Before every pull, gitseq records your state in refs/gitseq/backup — any sync can be undone with git reset --hard refs/gitseq/backup.

Conflict handling

If the same page changed on two machines, gitseq resolves it automatically — no terminal required:

  • Plaintext pages/journals: a union merge keeps both sides' lines. Both machines appended to today's journal? Both bullets survive. The worst case is a duplicated bullet you tidy up in the app.
  • Files that can't be text-merged (git-crypt encrypted files, images): your local version keeps the page, and the remote version is saved next to it as Page (sync conflict 2026-07-02 15.30.12). Search "sync conflict" in Logseq to review and reconcile — the conflict pages sync to your other machines too.
  • Edit vs. delete: the edit wins. gitseq never resolves a conflict by throwing words away.

Encrypted graphs are handled safely: gitseq never asks git to merge ciphertext (that would corrupt it), and conflict copies of encrypted files are stored encrypted on the remote.

If resolution ever fails, the repository is restored to its pre-sync state — gitseq never leaves you stranded mid-merge.

Toolbar indicator

Dot color Meaning
Green Clean — in sync with remote
Yellow Uncommitted local changes
Gray Offline — committed locally, not yet pushed
Red Error — check dev console (Cmd+Option+I)
Blue (spinning) Sync in progress

Command palette

Cmd+Shift+P and search for:

  • gitseq: Sync Now — full sync (same as Cmd+S)
  • gitseq: Pull — commit + pull, without pushing
  • gitseq: Push (no pull) — add, commit, push (escape hatch)
  • gitseq: Show Status — refresh the toolbar indicator

Settings

Plugins > gitseq > Settings:

Setting Default Description
Sync Mode manual manual (Cmd+S only) or periodic (auto-sync on timer)
Periodic Interval 15 Minutes between auto-syncs
Commit Message sync: {{date}} {{date}} is replaced with ISO timestamp
Sync on Startup true Full sync when Logseq opens
Sync on Close true Full sync before Logseq closes
Auto-Resolve Conflicts union+copies union+copies (auto-merge text, copies for the rest), copies-only (never auto-merge), or off (resolve in a terminal yourself)

Setup guide

New graph

  1. Open Logseq → create a new graph
  2. Initialize git and push:
cd ~/Documents/my-graph
git init && git branch -M main
  1. Create .gitignore:
.DS_Store
Thumbs.db
.logseq/
.obsidian/
logseq/bak/
logseq/.recycle/
.Trash/
  1. Commit and create a private remote:
git add -A && git commit -m "Initial commit"
gh repo create my-graph --private --source=. --push
  1. Install gitseq from the marketplace. Done.

Adding encryption (optional)

Encrypt journals, pages, and assets on GitHub while keeping them plaintext locally:

brew install git-crypt   # macOS
git-crypt init

Create .gitattributes:

journals/** filter=git-crypt diff=git-crypt
pages/** filter=git-crypt diff=git-crypt
assets/** filter=git-crypt diff=git-crypt

Export and back up your key:

git-crypt export-key ~/.git-crypt-my-graph.key

Store the key in a password manager. Without it, your encrypted files are unrecoverable.

Setting up a second machine

git clone git@github.com:youruser/my-graph.git ~/Documents/my-graph
# If encrypted:
git-crypt unlock ~/.git-crypt-my-graph.key

Open the graph in Logseq. Install gitseq. Done.

Troubleshooting

"You do not have the initial commit yet" — Logseq's internal git is pointing elsewhere. Make sure your graph folder has .git with at least one commit.

Authentication failures — Logseq's sandbox may not inherit your SSH agent. Verify with ssh-add -l or configure git config --global credential.helper osxkeychain.

Cmd+S doesn't work — another plugin may have claimed it. Use Cmd+Shift+P → "gitseq: Sync Now".

A sync did something you didn't want — every sync records the previous state first. Undo with: git reset --hard refs/gitseq/backup (then sync again once you're happy).

"Repository is in the middle of a merge or rebase" — a manual git operation (or an interrupted one) was left unfinished. In a terminal, run git merge --abort or git rebase --abort inside the graph, then sync again.

License

MIT

About

Git-based sync for Logseq — encrypted, one-keystroke commit & push

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors