Sync git repositories with dom0 (qubes-git-syncer)

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:

Source Code

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

Cross referencing:

1 Like

May you please rename this guide to: Sync git repositories with dom0

Done.

2 Likes

There is git-remote-qubes

You can use this to push pull between VMs and conceivably dom0, but be aware that you are trusting the binaries in the VM serving your repo to dom0, obviously.

I use it all the time, just not with dom0.

1 Like