Creating Templates
Last updated
Last updated
Existing repositories can serve as templates for future repositories. Anyone who has at least Read permissions for a repository template can clone that repository and use it as the base for a new repository.
Suppose your organization creates machines for customers. You could create a repository for your base program and establish it as a template. For each new customer, you could create a new repository based off of the original template and then add modifications accordingly.
If you update a repository template, other repositories that have that template as their base code will not automatically bring in those updates. You would need to manually update each repository using that specific template as base code.
If you have a repository that you want to use as a base to create future repositories, you'll need to set it as a template.
Navigate to your repository and click on the Settings tab.
Under the Repository tab, find and enable the Make Repository a Template option. Click the Update Settings button to set the repository as a template.
When creating a template, information on collaborators and branches are not copied over. However, the teams from the original repository are included in the template.
There are two ways to create a new repository from an existing template. You can either start by creating your new repository and assigning a preexisting template to it, or you can navigate to a template repository and use it to create a new repository.
Create a new repository as you normally would by performing the operation in the Creating Repositories section.
Complete the form by providing a Repository Name and Description. Clicking on the Template dropdown will reveal a list of existing templates. Select the template you wish to use.
Press the Create Repository button to finish setup.
Navigate to the repository that contains your template. Select the Use This Template button to create a new repository.
Complete the form by providing a Repository Name and Description. You'll note that whatever template you started from will be automatically applied to the Template dropdown.
Press the Create Repository button to finish setup.
Repositories that have been set as templates will display a unique template icon in file view.
This same icon will prepend all repository names on the dashboard and desktop app.