Sync git repositories with dom0

This solution is intended have git repos easily in sync with dom0.

The initial motivation is to reduce the toil on the development of SaltStack/Jinja states for Qubes.

The solution consists of a bash file (dom0-syncer.sh - a lib) with a function. It should be added somewhere in the project.

On project root path, the user should create one (or two) bash script "sourcing the lib" (bash's "importing") and calling the function (as described in Suggested Usage).

Under the hood

To sync a git repo from dom0 to vm:

# dom0:
git bundle create $DOM0DIRPATH/$FILENAME --all

sudo qvm-move-to-vm $VM_NAME $DOM0DIRPATH/$FILENAME

To sync a git repo to dom0:

# dom0:
sudo qvm-run --pass $VM_NAME 'cd ${VMPATH} && git bundle create - --all ' > $DOM0DIRPATH/$FILENAME

Context (History)

We are in Qubes 4.1.2. It's 2023-12. First contribution by Bruno Schroeder.

Similar effort by @solene: - (https://dataswamp.org/~solene/2023-06-17-qubes-os-git-bundle.html)

Source Code

It's GPL v3+, be my guest at codeberg:

https://codeberg.org/brunoschroeder/qubes-git-syncer