cloning repository from gitweb

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)

  • Categorize git repositories
  • How to list git commits for Android release?
  • gitweb snapshot of sub-directory
  • I can't see my project in gitweb. How do you configure gitweb properly?
  • Cannot see repositories
  • How to get Jenkins to connect to git repository
  • Making Git, Gitweb and Gitolite work on Debian Wheezy
  • Ubuntu: gitweb always looks for projects in /var/cache/git (“404 - no projects found”)
  • 2 Solutions collect form web for “cloning repository from gitweb”

    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
    

    You can try fetching repo using http:// instead of git://.

    For instance, Linux git repo at https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ can be cloned using http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

    Try replacing git:// with http:// or https:// and see if it does the trick.

    Reconstructing git repository file-by-file may be possible, but considering that the repository still exists, it does not make much sense. You may try contacting repo owners and check if they would be willing to either fix repo access.

    Git Baby is a git and github fan, let's start git clone.