'Sync a git repository between two local devices without internet connection

I have a repository repo on github and I have its clone on my local system (mac) which I use to make edits and push on daily basis; mac has an internet connection for doing this.

But the project is deployed on a NVIDIA Jetson device jetson which does not have access to an internet connection at all times. (This is because I have disabled dhcp to provide a static IP to its eth0 interface.) For deployment and testing, I use various ssh tools to migrate the code from mac to jetson.

How can I sync the repository on mac and jetson which only communicate via ssh ?



Solution 1:[1]

If you don't need the full history of the repository on the destination side, you might consider git archive instead of git bundle.

That way, you have only one file (an archive) to rsync or scp over, and then uncompress.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC