I'm using gitlab. When I go into the interface, on each branch I can download the source code as a zip, tar or whatsoever.
I am making rpm spec files for which I would need the possibility to download the tar ball using command line. since I added my rsa key i can do git clone without problems:
git clone http://gitlab/group/project.git
Cloning into 'project'...
remote: Counting objects: 1885, done.
remote: Compressing objects: 100% (826/826), done.
remote: Total 1885 (delta 1194), reused 1496 (delta 954)
Receiving objects: 100% (1885/1885), 1.30 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1194/1194), done.
Checking connectivity... done
However doing
wget http://gitlab/group/project/repository/archive.zip
gets me these errors:
Resolving gitlab (gitlab)... 10.1.253.75
Connecting to gitlab (gitlab)|10.1.253.75|:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
For me the
private_token
and thesha
orref
parameters does not worked together. So, I changed the way, and I tell my private token via a header parameter to the Gitlab API, like this:try this
Since GitLab 6.2 and issue 5253, it should be:
But that seems for internal use only, since you cannot know the id of a project as a user (only its name).
Don't forget, as
shown in ability.rb
, that downloading an archive is linked to a permission. Make sure you have that "download_code
" permission set for your project.Here, it must be a permission issue, because, for instance:
That works just fine, and get the content of that project without any issue.
However, as the OP Chris Maes comments and mentions in issue 6645, as as illustrated by
app/models/ability.rb
:... that "
dowload_code
" feature is only for public projects.