两台笔记本电脑如何在没有互联网的情况下互相推拉 [英] How two laptops can git push/pull to each other with no internet
问题描述
(User @ bee ,实际上我在输入时遇到了这个问题,但显然不是我发送的。在我们的例子中,我们都使用Mac笔记本电脑 - OSX Snow Leopard - 但我认为它会是更好地处理这个问题。)
最简单的解决方案可能是设置一个ad-hoc无线和SSH海誓山盟的笔记本电脑。您可以使用
$ git remote add cohacker myuser @ cohackers-laptop:/path/to/repo.git来设置您的远程设备
现在您可以推/拉到您心中的内容:
$ git pull cohacker master
... hack away ...
$ git push cohacker master
Say my co-hacker and I find ourselves on a desert island. Normally we push and pull to github to sync with each other. How would you recommend we do so when we have no connection to the outside world?
(User @bee and I actually have that problem as I type this, though obviously not as I send this. In our case we both have Mac laptops -- OSX Snow Leopard -- but I think it would be better to treat this question generically.)
The simplest solution is probably to just set up an ad-hoc wireless and SSH to eachother's laptops. You can set up your remote with
$ git remote add cohacker myuser@cohackers-laptop:/path/to/repo.git
Now you can push/pull to your heart's content:
$ git pull cohacker master
... hack away ...
$ git push cohacker master
这篇关于两台笔记本电脑如何在没有互联网的情况下互相推拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!