存在简单的一次性共享git repo的工具? [英] What tools exist for simple one-off sharing of a git repo?

查看:113
本文介绍了存在简单的一次性共享git repo的工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎经常遇到这样的情景,我想快速让某人有办法从例如克隆中复制git repo。我的笔记本电脑,并且我希望在不运行SSH守护进程,git守护进程或任何其他需要配置(甚至访问控制)的服务的情况下执行此项壮举。



我到目前为止最简单的方法是安装 adsf 命令行web服务器gem for Ruby,请确保运行 git update-server-info ,然后在我想要共享的目录中运行 adsf 。例如,如果我在repo的根目录下运行它,我会告诉另一方克隆 http://< my_hostname_or_ip>:3000 / .git ,或者服务器启动的任何端口。



这种方式运行得很好,但是它具有并发访问引起的问题以及需要安装Ruby和特定gem的问题。

您使用或知道的其他工具或黑客还会执行类似的功能吗?

编辑:澄清,我正在寻找像 hg serve 这样的解决方案:临时,快速和无痛,需要最少的设置和没有持久性服务。 / p>

解决方案

从某处运行此操作。

  git daemon --export-all --base-path = / tmp --port = 9090 / tmp / foo /。 git 

/tmp/foo/.git 是您想要公开的目录。



然后你可以把它克隆到别的地方,就像这样

  git clone git:// localhost:9090 / foo testdir 

您将在testdir中获取存储库。

完成后用 ^ C 杀死服务器。它也可以选择启用/禁用哪些服务。 git help daemon 获取更多信息。我认为它比 adsf 更直截了当。

I seem to often come across scenarios where I'd like to quickly give someone the means to clone a git repo from e.g. my laptop, and I'd like to perform this feat without running an SSH daemon, git daemon or any other kind of service requiring configuration (or even access control).

The simplest way I've come up with so far is to install the adsf command line web server gem for Ruby, make sure to run git update-server-info and then just run adsf in the directory I want to share. If I run it in the root of the repo, for example, I would then tell the other party to clone http://<my_hostname_or_ip>:3000/.git, or whatever port the server started on.

This works well enough, but does have the caveats of problems caused by concurrent access and the need to have Ruby and the particular gem installed.

What other tools or hacks do you use or know of that perform a similar function?

edit: to clarify, I'm looking for a solution like hg serve: ad hoc, quick and painless, requiring minimal setup and no persistent services.

解决方案

Run this from somewhere.

git daemon --export-all --base-path=/tmp --port=9090 /tmp/foo/.git

/tmp/foo/.git is the directory you want to expose.

Then you can clone it somewhere else like so

git clone git://localhost:9090/foo testdir

And you'll get the repository in testdir.

Kill the server with ^C when you're done. It can also take options on what services to enable/disable. git help daemon for more info. I think it's much more straightforward than adsf.

这篇关于存在简单的一次性共享git repo的工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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