Prerequisites

Generate and Add SSH Key for GitHub

Generate an SSH Key

Windows (Git Bash) / Linux / macOS:

ssh-keygen -t ed25519 -C "your-email@example.com"

Press Enter to accept the default location (~/.ssh/id_ed25519). Set a passphrase if desired.

Start the SSH Agent

Windows (Git Bash) / Linux / macOS:

eval "$(ssh-agent -s)"

Add Your SSH Private Key to the Agent

Windows (Git Bash) / Linux / macOS:

ssh-add ~/.ssh/id_ed25519

If you see an error on macOS

Could not open a connection to your authentication agent Run:

eval "$(ssh-agent -s)"

On Windows

If using PowerShell or CMD, use Git Bash instead. GitHub Desktop depends on the keys managed in Git Bash.

Copy Your SSH Public Key

Windows:

clip < ~/.ssh/id_ed25519.pub

macOS:

pbcopy < ~/.ssh/id_ed25519.pub

Linux:

xclip -sel clip < ~/.ssh/id_ed25519.pub

Add the SSH Key to GitHub

  1. Go to https://github.com/settings/keys
  2. Click New SSH key
  3. Paste the key, give it a title, and click Add SSH key

Use SSH in GitHub Desktop

  1. Open GitHub Desktop
  2. Go to File > Clone Repository
  3. Select the URL tab and make sure it starts with: git@github.com:username/repo.git (not https://)

This ensures GitHub Desktop can authenticate using your SSH key.

Clone the Repository with GitHub Desktop

  1. Open GitHub Desktop.
  2. Login and authenticate with oAuth (or your preferred method)
  3. Go to File > Clone Repository.
  4. Select the URL tab and enter your newly created repository url, making sure it starts with: git@github.com:username/repo.git (not https://)

    This ensures GitHub Desktop can authenticate using your SSH key.

  5. Choose a local directory for the repository (e.g., ~/Documents/my-obsidian-vault).
  6. Click Clone.

Set Up Obsidian

  1. Open Obsidian.
  2. Click Open folder as vault and select the local folder you cloned using GitHub Desktop.

Install Obsidian-Git Plugin

  1. Go to Settings > Community Plugins in Obsidian.
  2. Turn on Safe Mode if it’s off.
  3. Click Browse and search for Obsidian Git.
  4. Install and enable the Obsidian-Git plugin.

Configure Obsidian-Git

The plugin obsidian-git will interfere with GitSync, so you will need to disable it on your mobile devices!

This can easily be done by opening your Obsidian vault on your mobile device, scrolling to the bottom of the Git settings and enabling disable on this device

  1. Go to Settings > Obsidian Git.
  2. Set the following options:
    • Auto commit-and-sync interval (minutes): (e.g., 5 minutes).
    • Auto commit-and-sync after stopping file edits: Enabled.
    • Commit message on auto commit-and-sync: Customize or leave as default.
    • Pull on startup: Enabled.
    • Push on commit-and-sync: Enabled.
    • Pull on commit-and-sync: Enabled.
  3. Save changes.

Step 7: Syncing Changes

  • Pulling Changes: On startup, Obsidian-Git automatically pulls changes from GitHub.
  • Pushing Changes: Obsidian-Git automatically commits and pushes changes based on the set interval.

You’re now set up to sync your Obsidian vault on Desktop!