Can I download a git repository without git? Can I download a git repository without git? git git

Can I download a git repository without git?


On the server with the git repository, create a shell script that exports and zips the code, then download that zip from the other machines.

For example:

cd /pub/git/project.gitgit archive --format=zip --prefix=project/ HEAD > /home/project/public_html/downloads/project-dev.zip


Also, to make this generate HEAD on-demand, use a server-side script to execute the shell script and provide the zip file for download.

Here's a basic CFML script that does this - but it can obviously be written in any server-side language.

<cfset OutputFilename = "#ProjectName#-dev.zip"/><cfexecute name="/home/project/latest.sh"/><cfheader name="Content-Disposition" value="inline; filename=#OutputFilename#"/><cfcontent file="./#OutputFilename#" reset type="application/zip"/><cfsetting showdebugoutput="false"/><cfabort/>


EDIT: The cgit web interface to git supports this out of the box. View any commit and you can download a .zip, .tar.gz or a .tar.bz2


You can just scp(1) a git repository to your local machine, if you have ssh access to the machine on which the git repository resides. When you want to merge the history, you can scp the new repo back and merge.


Can you add a web-based Git browser to the computers hosting these repositories? Something like Gitweb or similar?