Currently I use Obsidian on my laptop that is running Linux as well as my desktop PC that is running Windows, and I use the Obsidian Git plugin in order to sync my vault to the same GitHub repo. Because I did the initial setup in Linux on my laptop, when I completed the setup on Windows I needed to clone my existing repository instead of initiating a new one.
Prerequisites
- Git must be installed and up to date - follow instructions on the official Git website
- Enable credential helper - running
git config credential.helpershould give an output ofmanager - Configure a personal access token on GitHub. I already had one from setting up my private Obsidian vault that I also sync with git, so I just added my Quartz repo to that token as well.
Cloning an Existing Remote Vault on Windows 11
I decided to name my local quartz repository quartz-git-sync to be consistent with the naming of my private vault which is obsidian-git-sync. I decided to store it in a similar place as well at C:\Users\<MyUser>\Documents\obsidian\quartz-git-sync like this:
C:\
└── Users\
└── <MyUser>\
└── Documents\
└── obsidian\
├── obsidian-git-sync\
└── quartz-git-sync\Using Git Bash on windows I changed to the directory where I wanted my local repo to be and cloned the remote:
cd ~/Documents/obsidian/quartz-git-sync
git clone https://github.com/<username>/<repo>.gitAfter that, I simply opened up Obsidian and selected “Open folder as vault” and chose the content folder within the quartz folder so my vault contains only the Markdown files that I create for the website and don’t have include all of the other config files that quartz generates.
From there, my vault loaded up right away with all the latest notes I created on my laptop and committed to the remote repo! All there was left to do was configure some Obsidian settings since my .gitignore file by default doesn’t sync anything in the .obsidian file. I actually ended up tweaking this a bit, which you can see here: .gitignore.