Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cloning repository from gitweb

Tags:

I want to clone a git repository whose git:// server is down.

Fortunately its gitweb interface is still working and all the data required to reconstruct the git repository is available from there.

So, is there any git command or other tool able to clone a git repository from gitweb?

(I could write a bot myself, but don't want to waste my time doing it if there is another way)

like image 265
salva Avatar asked Nov 23 '13 17:11

salva


People also ask

How do I clone a Git repository from a remote server?

To Git clone a repository navigate to your preferred repository hosting service like GitHub, select the repository you want to clone, copy the repository URL via HTTPS or SSH, type git clone in the command line, paste the URL, and hit enter .

How do I clone a VST repository?

From your web browser, open the team project for your Azure DevOps organization, and then choose Repos > Files to open the Files view. In the Files view, choose Clone to launch the Clone Repository popup. Copy the clone URL from the Clone Repository popup.


1 Answers

gitweb is just a perl script (gitweb.perl):

  • called by Apache (as in this config)
  • which reads the bare repos from its server.

If enabled in the gitweb.conf, gitweb can serve "snapshots" (in zip or tag.gz format), but this isn't the full history of the repository: it is only a compressed archive of any tree or commit, as produced by git-archive.

http://<gitweburl>/gitweb.cgi?p=<repo>.git;a=snapshot;h=HEAD

If there is any command, it needs to be executed on the server.
For instance, you can ask for a bundle (git bundle):

cd /path/to/bare/repo
git bundle create ../repo.bundle --all

That will create one file, that you can sftp back to your local station, and which acts as a git repository (read only, clone/pull only, no push):

cd /path/to/repo.bundle
git clone repo.bundle
cd repo
like image 196
VonC Avatar answered Sep 21 '22 21:09

VonC