Eric Eric - 20 days ago 5
Git Question

How can I push/fetch a git repository over a Bluetooth connection?

I have two Windows machines that can only connect to each other by Bluetooth. Each has a copy of a git repository on them, possibly with divergent histories.

Obviously, I could just zip up the entire .git folder at one end, send it with

fsquirt
, then unzip it at the other, and fetch from the local now-bare repository.

But what if I want to only send the contents of the new commits? Can git "pack files" help here?

Answer

If git cannot reach the remote filesystem directly through a supported connection protocol, you are essentially looking at what offline options git has. For most purposes, having git create a bundle containing what you need transferred is enough.

git bundle create repo.bundle master

would create a full copy of the current repository in the single file repo.bundle which you can then transfer and use as a read-only repository in the other end. Various options allow you to transfer only parts, but I would recommend against it until you are familiar enough with this to know what you are doing and can find out on your own.

See the Git Book for full instructions: https://git-scm.com/blog/2010/03/10/bundles.html

Comments