Feature: Select a template by default on the Repository create page #4901

Open
opened 2025-11-02 06:06:42 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @HappyStriker on GitHub (Feb 20, 2020).

The new feature of 1.11, which allows the creation of template repositories, is great and is especially useful if people without a deep understanding of git are using Gitea, so they can properly use e.g. Git LFS without any knowledge about it, as the template sets up the required .gitattributes file.

To allow the usage of Gitea templates to be even more straightforward for beginners it would be great if the admin has the ability to preselect a template as well as the default template elements in the app.ini config file, so the user just has to enter the name of the description of the repository and does not need to have any further knowledge of the template details.

So for the realisation of this feature it would be a solution to add something like the following keys to the app.ini configuration file:

[repository]
DEFAULT_TEMPLATE = userx/templatex
DEFAULT_TEMPLATE_ELEMENTS = branch, git-hooks, web-hooks, theme, logo, issue-labels

Thank you for all work on Gitea so far and for considering and hopefully implementing this feature request!

Best regards,
Happy Striker.

Originally created by @HappyStriker on GitHub (Feb 20, 2020). The new feature of 1.11, which allows the creation of template repositories, is great and is especially useful if people without a deep understanding of git are using Gitea, so they can properly use e.g. Git LFS without any knowledge about it, as the template sets up the required `.gitattributes` file. To allow the usage of Gitea templates to be even more straightforward for beginners it would be great if the admin has the ability to preselect a template as well as the default template elements in the `app.ini` config file, so the user just has to enter the name of the description of the repository and does not need to have any further knowledge of the template details. So for the realisation of this feature it would be a solution to add something like the following keys to the app.ini configuration file: ``` [repository] DEFAULT_TEMPLATE = userx/templatex DEFAULT_TEMPLATE_ELEMENTS = branch, git-hooks, web-hooks, theme, logo, issue-labels ``` Thank you for all work on Gitea so far and for considering and hopefully implementing this feature request! Best regards, Happy Striker.
GiteaMirror added the type/proposal label 2025-11-02 06:06:42 -06:00
Author
Owner

@lunny commented on GitHub (Feb 20, 2020):

The template repository is dynamically created by user, so you cannot set it on app.ini.

@lunny commented on GitHub (Feb 20, 2020): The template repository is dynamically created by user, so you cannot set it on app.ini.
Author
Owner

@HappyStriker commented on GitHub (Feb 20, 2020):

Yeah thats right, but after it has been created we know the path to it and therefore we can specify it as the default template for all users.
This feature might not seem very appropriate for many use cases, as the individual users have custom templates, but in managed systems with an unified purpose and centrally managed template selecting the default template is a vital feature to help less practised git users to get started.

@HappyStriker commented on GitHub (Feb 20, 2020): Yeah thats right, but after it has been created we know the path to it and therefore we can specify it as the default template for all users. This feature might not seem very appropriate for many use cases, as the individual users have custom templates, but in managed systems with an unified purpose and centrally managed template selecting the default template is a vital feature to help less practised git users to get started.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4901