Template Repository #4374

Open
opened 2025-11-02 05:48:36 -06:00 by GiteaMirror · 16 comments
Owner

Originally created by @jolheiser on GitHub (Nov 22, 2019).

Continues #7365 with a new issue so I can more closely update the head description as things are implemented/changed.

Hopefully implemented by 1.11.0:

Implemented after 1.11.0/unknown:

  • Wiki
  • Issues/PRs (in my opinion these shouldn't be part of a template generation)
  • Teams, contributors if new repo owner == template owner.
  • Branches/Protection Rules 1
  • Repo permissions
  • Squash the commits. When create a repository from a template repository. We may want to squash all the commits on the template repository as one commit may has a default commit log init project. And the author and committer is the repository creator. (hesitation)
  • API support [PR #1507] [MERGED] Better URL validation (#15934)
  • Expand file/directory names #14273

Feel free to suggest more to add to this list, or changes to this list.

Originally created by @jolheiser on GitHub (Nov 22, 2019). Continues #7365 with a new issue so I can more closely update the head description as things are implemented/changed. Hopefully implemented by `1.11.0`: - [x] Git Content #8768 - [x] Topics #8768 - [x] Git Hooks #8926 - [x] Webhooks #8926 - [x] Avatar #9149 - [x] Issue Labels #9149 - [x] [Auto-Expand](https://golang.org/pkg/os/#Expand) specified variables [1](https://github.com/go-gitea/gitea/issues/7365#issuecomment-508971493) [2](https://github.com/go-gitea/gitea/issues/7365#issuecomment-552623259) #9163 #10021 Implemented after `1.11.0`/unknown: - [ ] Wiki - [ ] Issues/PRs (in my opinion these shouldn't be part of a template generation) - [ ] Teams, contributors if new repo owner == template owner. - [ ] Branches/Protection Rules [1](https://github.com/go-gitea/gitea/issues/7365#issuecomment-549977020) - [ ] Repo permissions - [ ] Squash the commits. When create a repository from a template repository. We may want to squash all the commits on the template repository as one commit may has a default commit log init project. And the author and committer is the repository creator. ([hesitation](https://github.com/go-gitea/gitea/issues/7365#issuecomment-552680554)) - [x] API support #15934 - [ ] Expand file/directory names #14273 Feel free to suggest more to add to this list, or changes to this list.
GiteaMirror added the type/featureissue/confirmedtype/summary labels 2025-11-02 05:48:36 -06:00
Author
Owner

@guillep2k commented on GitHub (Nov 22, 2019):

Mm.... This calls for a voting system embedded in Gitea. 🤔 😁

@guillep2k commented on GitHub (Nov 22, 2019): Mm.... This calls for a voting system embedded in Gitea. 🤔 😁
Author
Owner

@lunny commented on GitHub (Nov 23, 2019):

Are all branches of the git repository moved?

@lunny commented on GitHub (Nov 23, 2019): Are all branches of the git repository moved?
Author
Owner

@jolheiser commented on GitHub (Nov 23, 2019):

Are all branches of the git repository moved?

Currently only default branch is copied, although @guillep2k has proposed some use-cases I linked in the above list that might be beneficial.

@jolheiser commented on GitHub (Nov 23, 2019): > Are all branches of the git repository moved? Currently only default branch is copied, although @guillep2k has proposed some use-cases I linked in the above list that might be beneficial.
Author
Owner

@dharmann commented on GitHub (Jan 17, 2020):

I'm trying to create a repo template. Is there some documentation explaining hot to do that?
Thanks!

@dharmann commented on GitHub (Jan 17, 2020): I'm trying to create a repo template. Is there some documentation explaining hot to do that? Thanks!
Author
Owner

@jolheiser commented on GitHub (Jan 17, 2020):

It is a setting in your repository. Keep in mind this feature is available only in 1.11+
template_settings

@jolheiser commented on GitHub (Jan 17, 2020): It is a setting in your repository. Keep in mind this feature is available only in 1.11+ ![template_settings](https://user-images.githubusercontent.com/42128690/72624577-d5f1b600-390c-11ea-93a3-edb510159bdc.png)
Author
Owner

@dharmann commented on GitHub (Jan 17, 2020):

It is a setting in your repository. Keep in mind this feature is available only in 1.11+
Thanks so much!

@dharmann commented on GitHub (Jan 17, 2020): > It is a setting in your repository. Keep in mind this feature is available only in 1.11+ Thanks so much!
Author
Owner

@bmackinney commented on GitHub (Mar 28, 2020):

Instead of copying the parent project Issues/PR's, I'd find utility in defining default Issues in files, perhaps like .gitea/template_issues/01-initialize-project.md - to provide child projects with the same set of checklists to complete and decisions to discuss and document. These files could contain yaml or toml frontmatter for processing into issue variables, and markdown bodies for the initial description.
Once templates copy branches, .gitea/template_PRs/01-begin-project.md could follow the same pattern but can include branch names in the frontmatter. Both directories could be excluded from the child project, like .gitea/template is.

@bmackinney commented on GitHub (Mar 28, 2020): Instead of copying the parent project Issues/PR's, I'd find utility in defining default Issues in files, perhaps like `.gitea/template_issues/01-initialize-project.md` - to provide child projects with the same set of checklists to complete and decisions to discuss and document. These files could contain yaml or toml frontmatter for processing into issue variables, and markdown bodies for the initial description. Once templates copy branches, `.gitea/template_PRs/01-begin-project.md` could follow the same pattern but can include branch names in the frontmatter. Both directories could be excluded from the child project, like `.gitea/template` is.
Author
Owner

@joshbalfour commented on GitHub (May 6, 2020):

please don't forget to fire the push webhook when a repository is created from a template! just noticed that it's not atm

@joshbalfour commented on GitHub (May 6, 2020): please don't forget to fire the push webhook when a repository is created from a template! just noticed that it's not atm
Author
Owner

@lunny commented on GitHub (May 7, 2020):

@joshbalfour Could you fire a bug issue?

@lunny commented on GitHub (May 7, 2020): @joshbalfour Could you fire a bug issue?
Author
Owner

@stale[bot] commented on GitHub (Jul 6, 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 6, 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

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

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Jul 20, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@chris-NR commented on GitHub (Apr 7, 2021):

A few additional suggestions:

  • Provide a default template setting (at service level and/or at organization level)
  • Use this setting when push-to-create is enabled (or allow template as a push option?)
  • Set initial tab (currently always "Code" but could be "Issues", "Projects" etc)
@chris-NR commented on GitHub (Apr 7, 2021): A few additional suggestions: - [ ] Provide a default template setting (at service level and/or at organization level) - [ ] Use this setting when push-to-create is enabled (or allow template as a push option?) - [ ] Set initial tab (currently always "Code" but could be "Issues", "Projects" etc)
Author
Owner

@clarfonthey commented on GitHub (Feb 5, 2022):

Something that I find useful that I haven't seen so far: it would be nice to be able to require custom variables on the template that the user has to fill out, which then get expanded in the .gitea/template files. For example, a repo may want to have both an identifier (${REPO_NAME}) and a proper "name" string which may contain spaces or other characters. Even if repo names could contain any character, this would still be desirable, imho.

@clarfonthey commented on GitHub (Feb 5, 2022): Something that I find useful that I haven't seen so far: it would be nice to be able to require custom variables on the template that the user has to fill out, which then get expanded in the `.gitea/template` files. For example, a repo may want to have both an identifier (`${REPO_NAME}`) and a proper "name" string which may contain spaces or other characters. Even if repo names could contain any character, this would still be desirable, imho.
Author
Owner

@twisted-nematic57 commented on GitHub (Jan 8, 2023):

I think it would also be great if it was possible to copy milestones and projects too, along with the wiki @jolheiser already suggested. (I created a template on my instance complete with project, milestone and template wiki, and was then disappointed I would have to copy it manually 😆)


Mm.... This calls for a voting system embedded in Gitea. thinking grin

@guillep2k I think the best way to implement that would be to make a Discussions tab in Gitea (just like there is in Github) and then make a "polls" section in that (again, just like Github).
edited Screenshot from 2023-01-07 16-41-30

@twisted-nematic57 commented on GitHub (Jan 8, 2023): I think it would also be great if it was possible to copy milestones and projects too, along with the wiki @jolheiser already suggested. (I created a template on my instance complete with project, milestone and template wiki, and was then disappointed I would have to copy it manually 😆) ------------------------------------------- > Mm.... This calls for a voting system embedded in Gitea. thinking grin @guillep2k I think the best way to implement that would be to make a Discussions tab in Gitea (just like there is in Github) and then make a "polls" section in that (again, just like Github). ![edited Screenshot from 2023-01-07 16-41-30](https://user-images.githubusercontent.com/70416002/211175848-6ca013ba-d063-4b85-a2b6-b74abba114f5.png)
Author
Owner

@bendem commented on GitHub (Mar 8, 2023):

Would be great if you could select settings to be copied over when creating from a template.

We want our merge strategies to be consistent across repos, wiki and issues are external so we want this to be ported too. It's a bunch of checkboxes that have to be verified for every new repo.

Another solution is to make that configuration available at the org level. That what bitbucket does, it's great.

image

@bendem commented on GitHub (Mar 8, 2023): Would be great if you could select settings to be copied over when creating from a template. We want our merge strategies to be consistent across repos, wiki and issues are external so we want this to be ported too. It's a bunch of checkboxes that have to be verified for every new repo. Another solution is to make that configuration available at the org level. That what bitbucket does, it's great. ![image](https://user-images.githubusercontent.com/2681677/226322079-0e1fffef-0b9c-4168-8ae9-5b003e84bf3b.png)
Author
Owner

@theAkito commented on GitHub (Mar 19, 2023):

Was about to suggest the same as @bendem did. I hoped, there'd be a global (or organisation wide - both would be great) default branch protection setting. For example, if I want the master branch to be protected, by default, so the repository owner has to specifically disable this to enable force pushes, etc.

@theAkito commented on GitHub (Mar 19, 2023): Was about to suggest the same as @bendem did. I hoped, there'd be a global (or organisation wide - both would be great) default branch protection setting. For example, if I want the master branch to be protected, by default, so the repository owner has to specifically disable this to enable force pushes, etc.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4374