Allow creating repository from a template via the API #5434

Closed
opened 2025-11-02 06:24:48 -06:00 by GiteaMirror · 14 comments
Owner

Originally created by @joshbalfour on GitHub (May 21, 2020).

  • Gitea version (or commit ref): 0b8b81e
  • Git version:
  • Operating system: arch
  • 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

Currently you can create a repository via the API, but not from a template, I know repo templates are a relatively new feature but it would be awesome if this could be included as a feature.

Sidenote: gitea is an awesome project by the way - big fan of this 🚀

Originally created by @joshbalfour on GitHub (May 21, 2020). <!-- 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): 0b8b81e - Git version: - Operating system: arch - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Currently you can create a repository via the API, but not from a template, I know repo templates are a relatively new feature but it would be awesome if this could be included as a feature. Sidenote: gitea is an awesome project by the way - big fan of this 🚀
GiteaMirror added the issue/confirmedtype/enhancementmodifies/api labels 2025-11-02 06:24:48 -06:00
Author
Owner

@DanMcLaughlin commented on GitHub (May 22, 2020):

I just came here to submit this - yes this would be great feature

@DanMcLaughlin commented on GitHub (May 22, 2020): I just came here to submit this - yes this would be great feature
Author
Owner

@6543 commented on GitHub (May 22, 2020):

this should not be hard to acheve - If I have a few free minutes I'll look at it

@6543 commented on GitHub (May 22, 2020): this should not be hard to acheve - If I have a few free minutes I'll look at it
Author
Owner

@stale[bot] commented on GitHub (Jul 25, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Jul 25, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@6543 commented on GitHub (Jul 25, 2020):

ping

@6543 commented on GitHub (Jul 25, 2020): ping
Author
Owner

@nudelbrot0451 commented on GitHub (Aug 19, 2020):

I would also be very interested in this. I need to autocreate a bunch of repositories for a students project and templates would make it possible to achive this.

@nudelbrot0451 commented on GitHub (Aug 19, 2020): I would also be very interested in this. I need to autocreate a bunch of repositories for a students project and templates would make it possible to achive this.
Author
Owner

@stale[bot] commented on GitHub (Oct 20, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Oct 20, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@morph027 commented on GitHub (Oct 20, 2020):

ping ;)

@morph027 commented on GitHub (Oct 20, 2020): ping ;)
Author
Owner

@richardolsen commented on GitHub (Sep 26, 2021):

Where is this at? The

/repos/{template_owner}/{template_repo}/generate

API end point doesn't work as expected with my setup which is fully private, the template itself isn't private. I have had no other troubles with the API except for this. I can create a new project from using the web front end but not via the API. Have tried both with token and username and password.

Otherwise loving Gitea, thank you and well done.

@richardolsen commented on GitHub (Sep 26, 2021): Where is this at? The /repos/{template_owner}/{template_repo}/generate API end point doesn't work as expected with my setup which is fully private, the template itself isn't private. I have had no other troubles with the API except for this. I can create a new project from using the web front end but not via the API. Have tried both with token and username and password. Otherwise loving Gitea, thank you and well done.
Author
Owner

@ijaureguialzo commented on GitHub (Sep 26, 2021):

Hi @richardolsen, I ran into this same issue and solved it in #16346 but it hasn't been integrated into the 1.15 branch.

If you use the 1.16 development branch, the endpoint works as expected, even with private templates.

@6543, could we open a new issue to backport the PR to the current stable branch? It would also close this one.

@ijaureguialzo commented on GitHub (Sep 26, 2021): Hi @richardolsen, I ran into this same issue and solved it in #16346 but it hasn't been integrated into the 1.15 branch. If you use the 1.16 development branch, the endpoint works as expected, even with private templates. @6543, could we open a new issue to backport the PR to the current stable branch? It would also close this one.
Author
Owner

@richardolsen commented on GitHub (Sep 26, 2021):

@ijaureguialzo Thanks so much, will d this. Most appreciated.

@richardolsen commented on GitHub (Sep 26, 2021): @ijaureguialzo Thanks so much, will d this. Most appreciated.
Author
Owner

@6543 commented on GitHub (Sep 29, 2021):

well ... I think we can backport?

@6543 commented on GitHub (Sep 29, 2021): well ... I think we can backport?
Author
Owner

@6543 commented on GitHub (Sep 29, 2021):

I try to cherry-pick but it looks already backported!

@6543 commented on GitHub (Sep 29, 2021): I try to cherry-pick but it looks already backported!
Author
Owner

@ijaureguialzo commented on GitHub (Sep 29, 2021):

Maybe I'm looking on the wrong place, but can't see PR #16346 on the 1.15 branch, only on master.

@ijaureguialzo commented on GitHub (Sep 29, 2021): Maybe I'm looking on the wrong place, but can't see PR #16346 on the 1.15 branch, only on master.
Author
Owner

@6543 commented on GitHub (Sep 30, 2021):

ok ... I missed something last time it looks like -> #17195

@6543 commented on GitHub (Sep 30, 2021): ok ... I missed something last time it looks like -> #17195
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5434