Gitea Cheatsheet
#
Gitea is a self-hosted Git service that provides repository management, code reviews, issue tracking, and CI/CD features, aiming for simplicity and efficiency.
General Commands
#
Command/Option | Example | Description |
---|
git clone <repo_url> | git clone https://gitea.example.com/user/repo.git | Clone a repository from Gitea |
git fetch | git fetch origin | Fetch changes from the remote repository |
git pull | git pull origin main | Pull changes from the remote repository and merge |
Branch Management
#
Command/Option | Example | Description |
---|
git branch | git branch | List all branches in the repository |
git branch <branch_name> | git branch feature-branch | Create a new branch |
git checkout <branch_name> | git checkout feature-branch | Switch to a different branch |
git merge <branch_name> | git merge feature-branch | Merge a branch into the current branch |
git branch -d <branch_name> | git branch -d feature-branch | Delete a branch |
Commit Management
#
Command/Option | Example | Description |
---|
git add <file> | git add . | Add files to the staging area |
git commit -m "message" | git commit -m "Add new feature" | Commit changes with a message |
git push | git push origin main | Push changes to the remote repository |
Pull Requests
#
Command/Option | Example | Description |
---|
git push origin <branch_name> | git push origin feature-branch | Push a branch to Gitea to create a pull request |
gitea pr create | gitea pr create --title "New Feature" --source branch_name --destination main | Create a new pull request |
gitea pr list | gitea pr list | List all pull requests |
gitea pr merge <pr_id> | gitea pr merge 123 | Merge a pull request |
gitea pr close <pr_id> | gitea pr close 123 | Close a pull request |
Repository Settings
#
Command/Option | Example | Description |
---|
gitea repo list | gitea repo list | List all repositories |
gitea repo create <repo_name> | gitea repo create my-repo | Create a new repository |
gitea repo delete <repo_name> | gitea repo delete my-repo | Delete a repository |
Access Management
#
Command/Option | Example | Description |
---|
gitea user list | gitea user list | List all users in the repository |
gitea user add <user> | gitea user add user@example.com | Add a user to the repository |
gitea user remove <user> | gitea user remove user@example.com | Remove a user from the repository |
CI/CD Pipelines
#
Command/Option | Example | Description |
---|
gitea-ci.yml | image: node:12\npipelines:\n default:\n - step:\n name: Build\n script:\n - npm install\n - npm test | Example configuration file for Gitea CI |
gitea ci status | gitea ci status | View the status of CI pipelines |
This cheatsheet covers the most commonly used Gitea commands and options, helping you manage repositories, branches, commits, pull requests, settings, access, and CI/CD pipelines effectively.