Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What tools exist for simple one-off sharing of a git repo?

Tags:

git

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.

like image 561
Ilkka Avatar asked Apr 28 '11 10:04

Ilkka


People also ask

What is forking in Git?

Forking is a git clone operation executed on a server copy of a projects repo. A Forking Workflow is often used in conjunction with a Git hosting service like Bitbucket. A high-level example of a Forking Workflow is: You want to contribute to an open source library hosted at bitbucket.org/userA/open-project.

What is Git repo command?

Repo helps manage many Git repositories, does the uploads to revision control systems, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git. The repo command is an executable Python script that you can put anywhere in your path.


1 Answers

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.

like image 93
Noufal Ibrahim Avatar answered Sep 30 '22 00:09

Noufal Ibrahim