Motivation

At first I was designing a complex multiple remotes git repository to synch my wsl and windows directories. I know that I can just cd into the /mnt/c/... directory and work there but lets just say that for every command that I run while in the windows side, I have to wait for 5 seconds for the starship prompt to show up.

But after some research I found out about unison which is a simple tool to synch directories.

Solution

As after testing the tool I found it to be very simple and effective so I decided to use it.

BUG

The file watcher does not work properly on the windows mount path, so until I find a solution unison has to be restarted manually for it to detect changes on the windows side.

I just had to install it on the wsl side

yay -S unison

And run the following command to synch the directories

unison ~/obsidian-vault /mnt/c/Users/pablo/Documents/ObsidianVault \
-auto -repeat=watch -prefer /home/hadronomy/obsidian-vault

The first two arguments are the directories to synch, the -auto flag ensures that the changes are propagated automatically, the -repeat=watch keep the process running and watching for changes and the -prefer /home/hadronomy/obsidian-vault flag ensures that the conflicts are resolved by keeping the wsl version.