How to use Git in a sneakernet environment?

一个人想着一个人 提交于 2019-12-03 09:53:15

Using Git with unconnected computers is easy with git bundle.

See its man page.

You can also keep a clone of the repository on a USB drive. 'push' from the off-net PC to the USB drive, then 'push' from the uSB drive to the central repository.

It might be better to have the USB drive repository with its own working directory (also on the USB drive). Then 'pull' to the usb drive from the off-net PC, and 'push' from the USB drive to the central repository. When that push happens, you can do merging, if necessary, on the USB drive.

Philip Oakley

Readers who get here are probably also interested in using-git-on-usb-stick-for-travelling-code which has a great set of similarities. It probably won't work for my environment where there are two of use doing the sneakernet use/edit movements (i.e two separate USB drives), but it is a possibility.

It all depends on how much you trust the transfer drive, and if the tools can work when you haven't got it plugged in....

chrisinmtown

I found this tutorial even more helpful than the man page because it gives an example of how Git checks that the incoming bundle and the target repository share a common ancestor commit:

https://git-scm.com/book/en/v2/Git-Tools-Bundling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!