how to download archive of private repository? #4429

Closed
opened 2025-11-02 05:50:24 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @iwzoo on GitHub (Dec 2, 2019).

  • Gitea version (or commit ref):
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I'd like to download the archives of repositories with wget or curl. I can do these with command
wget "https://mygit.com/user/myrepo/repository/master/archive.zip?private_token={token}"
for gitlab, what's the equivalent way to do so for gitea??

...

Screenshots

Originally created by @iwzoo on GitHub (Dec 2, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): - Git version: - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I'd like to download the archives of repositories with wget or curl. I can do these with command wget "https://mygit.com/user/myrepo/repository/master/archive.zip?private_token={token}" for gitlab, what's the equivalent way to do so for gitea?? ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@axifive commented on GitHub (Dec 2, 2019):

https://try.gitea.io/api/swagger#/repository/repoGetArchive

Authentication options:: https://docs.gitea.io/en-us/api-usage/

@axifive commented on GitHub (Dec 2, 2019): https://try.gitea.io/api/swagger#/repository/repoGetArchive Authentication options:: https://docs.gitea.io/en-us/api-usage/
Author
Owner

@iwzoo commented on GitHub (Dec 2, 2019):

https://try.gitea.io/api/swagger#/repository/repoGetArchive

Authentication options:: https://docs.gitea.io/en-us/api-usage/

thank you.

curl -X GET "https://mygit.com/api/v1/repos/{username}/{reponame}/archive/master.zip?token=f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" -o /tmp/test.zip

worked!!!

@iwzoo commented on GitHub (Dec 2, 2019): > https://try.gitea.io/api/swagger#/repository/repoGetArchive > > Authentication options:: https://docs.gitea.io/en-us/api-usage/ thank you. `curl -X GET "https://mygit.com/api/v1/repos/{username}/{reponame}/archive/master.zip?token=f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" -o /tmp/test.zip` worked!!!
Author
Owner

@axifive commented on GitHub (Dec 2, 2019):

curl -X GET "https://mygit.com/api/v1/repos/{username}/{reponame}/archive/master.zip" -H "Authorization: f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" -o /tmp/test.zip

Correct alternative: "Authorization: token f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f"

@axifive commented on GitHub (Dec 2, 2019): > curl -X GET "https://mygit.com/api/v1/repos/{username}/{reponame}/archive/master.zip" -H "Authorization: f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" -o /tmp/test.zip Correct alternative: "Authorization: token f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f"
Author
Owner

@iwzoo commented on GitHub (Dec 2, 2019):

curl -X GET "https://mygit.com/api/v1/repos/{username}/{reponame}/archive/master.zip" -H "Authorization: f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" -o /tmp/test.zip

Correct alternative: "Authorization: token f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f"

this also works.
:)

@iwzoo commented on GitHub (Dec 2, 2019): > > curl -X GET "[https://mygit.com/api/v1/repos/{username}/{reponame}/archive/master.zip](https://mygit.com/api/v1/repos/%7Busername%7D/%7Breponame%7D/archive/master.zip)" -H "Authorization: f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" -o /tmp/test.zip > > Correct alternative: "Authorization: token f3b623ca2f2becfe45d7cf0bc7d3d95577e12e8f" this also works. :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4429