Overview
Gitea provides full-featured Git repository management that supports all standard Git operations along with advanced features like Git LFS, protected branches, and repository mirroring. Built on native Git functionality, Gitea offers a web-based interface for managing your source code efficiently.Repository Creation
Create a New Repository
Navigate to the Gitea dashboard and click the ”+” icon or “New Repository” button. Repositories can be created under your user account or any organization where you have permissions.
Initialize with Options
Choose repository visibility (public/private), add a README, select a license, and configure a .gitignore template during creation.
Branch Management
Creating and Managing Branches
Gitea provides comprehensive branch management through both the web interface and Git operations:- Web UI
- Git CLI
Create a Branch
- Navigate to your repository
- Click the branch dropdown menu
- Type a new branch name
- Select the source branch
- Click “Create Branch”
- Access the “Branches” tab to see all branches
- View commits ahead/behind default branch
- See branch protection status
- Access branch deletion options
Protected Branches
Protect important branches from force pushes and require specific conditions before merging:Branch Protection Rules
- Require pull request reviews
- Enforce status checks
- Restrict who can push
- Prevent force pushes
- Require signed commits
Advanced Options
- Required approvals count
- Dismiss stale reviews
- Required status checks
- Allowed push users/teams
- Pattern-based protection
Branch protection rules are evaluated based on pattern matching. Use wildcards like
release/* to protect multiple branches with a single rule.Tag Management
Tags mark specific points in repository history, typically for releases:Creating Tags
- Web Interface
- Git CLI
- Navigate to Releases tab
- Click New Release
- Enter tag name (e.g.,
v1.0.0) - Select target branch or commit
- Add release notes
- Attach binary files if needed
Git LFS (Large File Storage)
Overview
Gitea includes built-in support for Git LFS, enabling efficient handling of large binary files:Enabling and Using LFS
Enable LFS for Repository
Repository administrators can enable LFS in the repository settings under the “Git LFS” section.
LFS objects are stored separately from the Git repository and retrieved on-demand. This keeps repository clones fast even with large files.
Repository Mirroring
Mirror from External Repository
Gitea can mirror repositories from external sources (GitHub, GitLab, Bitbucket, etc.):Configuring Repository Mirrors
Configuring Repository Mirrors
Pull Mirroring
- Mirror external repositories into Gitea
- Automatic sync on configurable intervals
- Supports authentication with tokens/passwords
- One-way synchronization (external → Gitea)
- Push Gitea repository to external Git hosting
- Automatic sync on push events
- Useful for backup and redundancy
- One-way synchronization (Gitea → external)
Repository Templates
Create repository templates to standardize new projects:Template Creation
- Create a repository with standard structure
- Enable “Template Repository” in settings
- Others can generate repositories from template
- Template includes files, directories, and history
Using Templates
- Click “New Repository”
- Select “Repository template” dropdown
- Choose from available templates
- Customize repository name and settings
Repository Transfer
Transfer repository ownership between users or organizations:Repository Archive
Downloading Repository Archives
Download repository snapshots in various formats:- ZIP: Compressed archive of repository contents
- TAR.GZ: Compressed tarball for Unix systems
- Bundle: Git bundle format with full history
Archiving Repositories
Archive repositories to make them read-only:Archived repositories are read-only. No pushes, pull requests, or issues can be created. This is useful for preserving historical projects.
Collaboration Features
Collaborators
- Add individual collaborators
- Assign read, write, or admin permissions
- Manage access per repository
- Remove access when needed
Teams (Organizations)
- Assign teams to repositories
- Team-based permissions
- Bulk access management
- Hierarchical organization
Best Practices
Repository Organization
Repository Organization
Naming Conventions
- Use descriptive, lowercase names
- Separate words with hyphens
- Avoid special characters
- Use
mainormasterfor production - Create feature branches for development
- Use semantic version tags for releases
- Protect main branches
- Include README.md with project description
- Add LICENSE file for open source
- Use .gitignore to exclude build artifacts
- Document contribution guidelines
See Also
- Pull Requests - Code review and merging workflow
- Issues - Bug tracking and project management
- Actions - CI/CD automation
- Wiki - Project documentation