Git’s distributed nature does not rely on central servers to host and broadcast your code. There’s more options available to you if for some reason your main server goes down, or perhaps when GitHub goes down.

Probably the easiest way to quickly export and share your code in this case is by making a bare clone of your repository, which contains only the stuff in the .git directory that’s usually at your project’s root folder. Since this one folder has all of the history stored in it, you can easily extract anything you need from it. Simply do:

git clone --bare ~/Dev/ruby/jekyll jekyll.git

and then upload the folder to a server somewhere, share it for others to find on your machine, etc. Copying it down onto your machine and doing these commands will restore the repository:

These basically prepare Git for access via a web browser. Provided Apache or your favorite server is set up to host that directory, you should be able to clone over http like so:

git clone http://yoursite.com/yourrepo.git

There’s plenty of other options as well. You could use OSX’s built in web sharing along with the previous technique to host it from your own machine. You could also use an ssh address if you have an ssh account set up on the server you want to share your code from.

If you’ve got any other handy ideas on how to share your repository, let us know in the comments!