A recent conversation on Discord showed that it can be difficult for new joiners to get Dendron up and running with git so I thought to post a little tutorial how this can be achieved. I hope this is useful for some. If I omitted steps since they appeared too obvious please let me know and I’ll update the info.
The goal is to have a Dendron “vault” synced between at least two machines.
Step 1 Set up a Git repo
I’m using Github here as an example but any git service will work as long as all machined can access it. To create a new repo log on to Github and click on “New” on the repositories tab.
In the follwoing screen choose a name (or accept the suggested name) and decide if the repos is going to be private or public.
After creation note the git URL in the clone command on the next page and copy it.
Step 2 Create a Dendron workspace
Start Dendron and create a new workspace if you don’t have one yet using the command
Dendron: Initialize Workspace. This will create a new workspace with an empty vault that looks like this (I’m using VSCodium here)
Of course any existing workspace works just as well.
Now add a new vault via
Dendron: Vault Add and choose
and enter the clone URL you copied above. Dendron will create a new vault using the name and populate it with a
Now create notes as you see fit and commit them using the source control view from the sidebar
Finally push to the remote Github repo.
If you want you can now delete the default local vault via
Dendron: Vault Remove.
Step 3 Sync to another machine
On your other machine follow the same steps to also add a remote vault again using the git URL from above. All commited and pushed changes should be present now.
From now on follow these steps on each of the machines:
- pull the latest changes from the Github repo
- work with your notes
- commit and push them back to the repo
There are some extensions that can be useful for working with git. One of my favourites is auto-git which - as the name suggests - automatically commits and pushes changes to a remote repository.