Gitea

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/OptionExampleDescription
git clone <repo_url>git clone https://gitea.example.com/user/repo.gitClone a repository from Gitea
git fetchgit fetch originFetch changes from the remote repository
git pullgit pull origin mainPull changes from the remote repository and merge

Branch Management #

Command/OptionExampleDescription
git branchgit branchList all branches in the repository
git branch <branch_name>git branch feature-branchCreate a new branch
git checkout <branch_name>git checkout feature-branchSwitch to a different branch
git merge <branch_name>git merge feature-branchMerge a branch into the current branch
git branch -d <branch_name>git branch -d feature-branchDelete a branch

Commit Management #

Command/OptionExampleDescription
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 pushgit push origin mainPush changes to the remote repository

Pull Requests #

Command/OptionExampleDescription
git push origin <branch_name>git push origin feature-branchPush a branch to Gitea to create a pull request
gitea pr creategitea pr create --title "New Feature" --source branch_name --destination mainCreate a new pull request
gitea pr listgitea pr listList all pull requests
gitea pr merge <pr_id>gitea pr merge 123Merge a pull request
gitea pr close <pr_id>gitea pr close 123Close a pull request

Repository Settings #

Command/OptionExampleDescription
gitea repo listgitea repo listList all repositories
gitea repo create <repo_name>gitea repo create my-repoCreate a new repository
gitea repo delete <repo_name>gitea repo delete my-repoDelete a repository

Access Management #

Command/OptionExampleDescription
gitea user listgitea user listList all users in the repository
gitea user add <user>gitea user add user@example.comAdd a user to the repository
gitea user remove <user>gitea user remove user@example.comRemove a user from the repository

CI/CD Pipelines #

Command/OptionExampleDescription
gitea-ci.ymlimage: node:12\npipelines:\n default:\n - step:\n name: Build\n script:\n - npm install\n - npm testExample configuration file for Gitea CI
gitea ci statusgitea ci statusView 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.

Gitea

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.