Forgejo Cheatsheet

Note: Forgejo is a self-hosted Git service. The web interface URL depends on your installation. Common path is /user/login for auth and /{user}/{repo} for repositories.

Getting Started

Clone a repository git clone https://forgejo.instance/user/repo.git
Add remote git remote add forgejo https://forgejo.instance/user/repo.git
List remotes git remote -v

Authentication

Personal Access Token Settings → Applications → Generate Token
Git clone with token git clone https://[email protected]/user/repo.git
Git push with token git remote set-url origin https://[email protected]/user/repo.git
SSH key setup Settings → SSH Keys → Add Key (paste public key)
Clone with SSH git clone [email protected]:user/repo.git

Repository Management

Create repository + → New Repository on web interface
Fork repository Click Fork button on repo page
Star repository Click star icon on repo page
Watch repository Click watch icon for notifications

Branches & Tags

View branches Navigate to /branches on repo page
Create branch git push origin new-branch or via web UI
Delete branch git push origin --delete branch or via web UI
Create tag git tag v1.0.0 && git push origin v1.0.0
View tags Navigate to /tags on repo page

Issues & Pull Requests

Create issue Issues → New Issue on web interface
View issues Navigate to /issues on repo page
Create pull request Compare branches or use PR button
View pull requests Navigate to /pulls on repo page
Close issue via commit Commit message: Fixes #123 or Closes #123
Reference issue in PR In PR description: Fixes #123

Actions & CI/CD

View actions Navigate to /actions on repo page
Workflow file location .forgejo/workflows/*.yml
Manual workflow dispatch Actions → Select Workflow → Run Workflow
View workflow runs Actions → Select Workflow → Recent Runs

Releases

Create release Releases → New Release on web interface
Upload assets Attach binaries to release via web UI
Pre-release Check "Pre-release" when creating release
Draft release Save as draft, publish later

Wiki

Access wiki Navigate to /_pages on repo page
Clone wiki git clone https://forgejo.instance/user/repo.wiki.git
Create wiki page Wiki → New Page on web interface

Organizations

Create organization + → New Organization on web
Manage members Organization → Settings → Members
Team management Organization → Teams on web interface

Search

Search repositories Explore → Search on main Forgejo page
Search code Repository → Search (or press T)
Search issues Issues → Search bar
Advanced search Use search syntax: is:issue is:open repo:user/repo

Forgejo CLI (forgejo)

Login forgejo login --url https://forgejo.instance --token TOKEN
List repos forgejo repo list
Create repo forgejo repo create my-repo --private
Fork repo forgejo repo fork user/repo
List issues forgejo issue list --repo owner/repo
Create issue forgejo issue create --repo owner/repo --title "Bug"
Run release forgejo release create v1.0.0 --repo owner/repo

API

Get repo info curl -H "Authorization: token TOKEN" https://forgejo.instance/api/v1/repos/user/repo
List issues curl -H "Authorization: token TOKEN" https://forgejo.instance/api/v1/repos/user/repo/issues
Create issue (POST) curl -X POST -H "Authorization: token TOKEN" -d '{"title":"Bug"}' https://forgejo.instance/api/v1/repos/user/repo/issues
List actions runs curl -H "Authorization: token TOKEN" https://forgejo.instance/api/v1/repos/user/repo/actions/runs