Repository Template Guide
Accessing Template Repositories
There are two ways to access template repositories:
Via URL Parameter
- Add
?template=true
to the repository URL - Example:
https://gitlink.org/org/repo?template=true
- Add
Through Interface
- Click "New Repository" button
- Select "Create from Template" option
Creating Template Repositories
Setting a Repository as Template
- Go to repository settings
- Find "Repository Type" option
- Check "Set this repository as template"
- Save settings
Template Repository Features
- Cannot be directly pushed to
- Can be used as template by anyone
- Maintains clean commit history
- Supports custom initialization configuration
Using Templates to Create Repositories
Basic Steps
- Visit template repository
- Click "Use this template" button
- Fill in new repository information
- Select branches to include
- Confirm creation
Custom Options
- Selectively copy branches
- Include all tags
- Copy Issue templates
- Preserve commit history
Best Practices
Template Repository Structure
template-repo/
├── .gitlink/
│ ├── ISSUE_TEMPLATE/
│ └── PR_TEMPLATE/
├── docs/
│ └── README.md
├── src/
├── tests/
├── .gitignore
└── README.md
Recommended Configuration
- Add detailed README
- Include necessary configuration files
- Provide example code
- Set up Issue and PR templates
- Configure CI/CD templates
Notes
- Template repositories should be minimal
- Update template content regularly
- Provide clear usage documentation
- Avoid including sensitive information