Skip to main content
Version: 1.1.0

Repository Template Guide

Accessing Template Repositories

There are two ways to access template repositories:

  1. Via URL Parameter

    • Add ?template=true to the repository URL
    • Example: https://gitlink.org/org/repo?template=true
  2. Through Interface

    • Click "New Repository" button
    • Select "Create from Template" option

Creating Template Repositories

Setting a Repository as Template

  1. Go to repository settings
  2. Find "Repository Type" option
  3. Check "Set this repository as template"
  4. 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

  1. Visit template repository
  2. Click "Use this template" button
  3. Fill in new repository information
  4. Select branches to include
  5. 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
  1. Add detailed README
  2. Include necessary configuration files
  3. Provide example code
  4. Set up Issue and PR templates
  5. Configure CI/CD templates

Notes

  1. Template repositories should be minimal
  2. Update template content regularly
  3. Provide clear usage documentation
  4. Avoid including sensitive information