1

If I clone a Github Repository , I do normally a git clone https://github.com/:username/:repo_name.git. But now I've wanted to download the bare-Repo with wgetbut it only returns the webpage. How can I download a git repo with http? I thought this is git over http that indeed is only a git repo served over http. But what's wrong with this request. I thought the git client do the same. Even fetch the repo with GET.

I'm grateful for any answer!

Sebi2020
  • 1,966
  • 1
  • 23
  • 40

2 Answers2

2

You could do git clone --bare to clone the repository as a bare repository

Lorenz
  • 106
  • 5
0

You can get an archive (meaning not the full history) with

wget https://github.com/username/reponame/tarball/master

This is part of the GitHub Content API:

GET /repos/:owner/:repo/:archive_format/:ref

with:

  • archive_format string: Can be either tarball or zipball.
    Default: tarball
  • ref string: A valid Git reference.
    Default: the repository’s default branch (usually master)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I want to fetch the repository on the way as it does git. If it communicate over http, I think I can also use wget to achieve that. – Sebi2020 Jun 30 '14 at 18:06
  • @Sebi2020 no, you can get an archive, meaning one specific version, not the full history. For the full history... a `git clone https://...` is still the best way. – VonC Jun 30 '14 at 18:07
  • So the webserver doesn't offer some way to download the entire git directory? – Sebi2020 Jun 30 '14 at 19:04
  • @Sebi2020 no, for now, this is a download service only (nodeload: https://github.com/blog/678-meet-nodeload-the-new-download-server), not a full repo bundle. – VonC Jun 30 '14 at 19:06