Repository templates let you quickly create code repositories from system or custom templates, reusing the project structure, code, and branch model of an existing repository. Organizations can define template repositories that align with their engineering standards for development teams to use.
System templates
Codeup provides built-in system templates for various frameworks, including Spring, NodeJs Express, Android, iOS, Go Micro, Ruby on Rails, .NET Core, and React. You can select one based on your project requirements.
-
Log on to Codeup and click Create Repository in the upper-right corner.
-
On the Template tab, create a code repository.
-
Enter the Repository Name, Repository Path, and Description. Select a Visibility Level and click OK.
-
After creation, the repository is initialized with code from the template repository:
For example, a repository named React-repo is created from the React template. Its default branch is master and it includes the initial file structure: public, src, .gitignore, package-lock.json, package.json, README.md, and tsconfig.json. The first commit message is "Initial commit". The README.md file shows that this is a React sample project. You can run
npm installto install dependencies and runnpm run startto launch the project. Then, you can access the project athttp://localhost:3000in your browser.
Custom templates
Codeup allows organizations to designate any code repository as a template to standardize project structures across development teams.
-
Log on to the Alibaba Cloud DevOps Codeup page and go to the code repository of the template that you want to customize.
Note-
Repository administrators can configure a repository as a template. Users with read permissions on the repository can then use the template.
-
A template repository must be smaller than 100 MB. You cannot create a repository from an oversized template.
-
-
Navigate to and find the Set as Template Repository option.
Enabling this toggle makes the current repository a template for creating new repositories with the same directory structure, files, and branches. Only users with read permissions on the repository can use this template.
-
Enable the Set as Template Repository switch.
After the configuration is complete, a Template Repository tag appears next to the repository in the code repository list.
-
Users with read permissions on the template repository can select it on the Custom Template tab when creating a code repository. This tab lists available custom templates with options to preview content and import all branches.
Note-
For custom template repositories, you can preview the repository content.
-
By default, only the default branch content is imported from a template repository. Select the import-all-branches option to include all branches.
-