两台笔记本电脑如何在没有互联网的情况下互相推拉 [英] How two laptops can git push/pull to each other with no internet

查看:124
本文介绍了两台笔记本电脑如何在没有互联网的情况下互相推拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我的黑客,我发现自己在一个荒岛上。通常我们会推送到github来相互同步。如果我们与外部世界没有任何关系,你会如何推荐我们这样做?

(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆