Git magic
This is just a showcase on how powerful git actually is. It is in no way
The situation
I am currently working on a windows computer with rainmeter. I also like to work in the wsl environment. Thus I want to have todotree available on both PowerShell and bash, and they need to sync between each other. Also, I do not want to use a remote repository such as github, gitlab, or gitea. Everything has to be local.
The solution
The solution only uses bare git and todotree, and does not need any external tool.
We will have three repositories. These paths are changed for readability, they can be anywhere on a filesystem.
- windows-todotree:
- Located at C:\todotree
- Used by PowerShell (using the script at ./configuration.md)
- linux-todotree:
- Located at /home/todotree
- Used by bash.
- Remote
- Located at /git/todotree
To set it up, do the following steps. modify the paths to suit your situation.
- Configure a bare repo at Remote:
mkdir -p /git/todotree
cd /git/todotree
git init --bare
- Configure linux-todotree:
mkdir /home/todotree
cd /home/todotree
touch todo.txt done.txt config.yaml
git init
git add *
git commit -m "First commit"
git remote add origin /git/todotree
git push
- Configure window-todotree
Set-Location C:\
git clone \\wsl$\Ubuntu-22.04\home\todotree
git push --set-upstream origin main