
Sync Obsidian with Git & GitHub
2025, August 20th - by Ricardo Guzman
I’ve been looking a way to sync my Obsidian Vault between my Mac and Linux machine.
Yeah, I know that there’s Dropbox, but I knew that Git/GitHub was an alternative that has two strong points for me:
- Free
- I just knew that a Version Control System was possible and I wanted that
So let’s setup Git/GitHub with Obsidian.
Prerequisites
- GitHub Account
- GitHub Personal Access Token: This token is important since is the password that you’ll be asked for when Authenticating on Github when pushing your changes.
- Git: Version Control System that you’ll need to install on your machine. Git Download Page
- Git Client (Optional): You could install GUI clients like GitHub Desktop.
- Obsidian
Setting Up Syncing System
1. Create a Private GitHub Repo
First we’ll need a remote repository to store our vault.
- Log In to your GitHub account
- Click “New” to create a new and give a name to it
- Crucially, set the repo to “Private” to ensure that your secrets are safe
- You can leave the rest of options as they are and click “Create Repository”
2. Initialize a Git Repository in Your Obsidian Vault
Now we need to convert our Obsidian Vault into a Git repo and connect it to GitHub.
- Open a terminal window and go to your Obsidian’s Vault Directory. You can usually find the path in Obsidian by right-clicking on the vault name in the left sidebar and selecting “Show in system explorer” (or similar)
- Run these commands:
# Initialize the git repo
git init
# IMPORTANT -> Create a .gitignore file. this will save you A LOT of headaches trust me.
# PD: This is the one I have and works for me, of course if you think that other files should be ignore you're to ignore them
echo ".obsidian/workspace.json\n.obsidian/workspaces.json\n.obsidian/plugins/obsidian-git/data.json\n.trash/" > .gitignore
# IMPORTANT -> Add the .gitignore first
git add .gitignore
git commit -m "chore: Add .gitignore"
# Now is when you add all your notes and files
git add .
# Now is when we commit our entire vault
git commit -m "Initial Vautl Commit"
# Connect local vault to your created GitHub Remote Repo (see instructions below to find your github repo url)
git remote add origin "https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git"
git branch -M main
git push -u origin main
To find your GitHub repo URL:
- Go to your GitHub Account and search your repo by the name you gave it
- Once in your repo go to the blue button “Code”
- Copy the URL that’s in the “HTTPS” tab
That’s the URL of your GitHub repo.
Now open the vault by opening Obsidian and then “Open Folder as Vault” and you’re in your Obsidian Vault with Git.
3. Install & Configure the Obsidian Git Plugin
Let’s download and configure the plugin that will make things possible.
- Go to “Community Plugins” and search for “Git”
- You should install the one created by “Vinzent (Denis Olehov)”
- Install and enable the blueprint.
- Now that you have enabled the plugin, you’re free to configure things as you prefer. I recommend these two:
- Pull On Startup
- Vault Backup Interval: select the intervals you want to pull and push changes.
Getting your GitHub Vault on a different machine
Perfect, you have your Vault synced with Git/GitHub, now let’s get this vault on another machine since that’s the point of this process anyway.
- Open your terminal window in your machine and go to the location you want your Obsidian vault to be in.
- Clone the repository. Run this command:
git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
This is the same repo URL from before
- Open in Obsidian:
- Launch Obsidian
- Choose “Open Folder as Vault” and select your newly cloned repo
- Install and enable the Git plugin and configure it the same way.
Conclusion
That’s it for this process.
That’s the process I followed and now I’m really happy with my syncing through GitHub.
Enjoy your free syncing.