3.7 KiB
3.7 KiB
GitRepoSetup - Quick Reference
Installation
# Python
cd python && uv sync
# Rust
cd rust && cargo build --release
# Go
cd go && go build
Basic Usage
gitreposetup --owner <ORG> --name <REPO>
CLI Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
--owner |
string | (config) | Repository owner/org |
--name |
string | (config) | Repository name |
--license |
enum | MIT | MIT, GPLv3, AGPLv3, Unlicense |
--develop-branch-name |
string | dev | Dev branch name |
--default-gitignore |
bool | true | Use default .gitignore |
--default-git-url |
string | (config) | Git remote URL template |
--force |
flag | false | Force overwrite LICENSE |
--deploy-type |
enum | - | docker, pypi, cargo, go |
Config File
Location: ~/.config/GMS/.config.yaml (Windows: %USERPROFILE%\.config\GMS\.config.yaml)
owner: MyOrg
name: ""
license: MIT
develop_branch: dev
default_gitignore: true
default_git_url: "https://git.theprivateserver.de/{owner}/{repo}.git"
What It Does
- Init/detect git repo
- Set
mainas default branch - Remove all remotes
- Set
originto templated URL - Add LICENSE (if missing or
--force) - Add/overwrite
.gitignore - Commit ("Initial commit")
- Create & checkout
devbranch - Try push; warn if fails
- Set up
.gitea/workflows/structure
Examples
# Basic
gitreposetup --owner PHB --name WorldTeacher
# Custom license
gitreposetup --owner MyOrg --name App --license GPLv3
# Python package
gitreposetup --owner MyOrg --name lib --deploy-type pypi
# Docker project
gitreposetup --owner MyOrg --name api --deploy-type docker
# Force license change
gitreposetup --owner MyOrg --name old --license MIT --force
Deploy Types
| Type | Workflows | Requires | Secrets |
|---|---|---|---|
pypi |
test-python, python_package-release | pyproject.toml | TOKEN, GITEA_TOKEN |
docker |
test-{lang}, test-{lang}-docker-build, docker-release | Dockerfile | REGISTRY, DOCKER_USERNAME, TOKEN, GITEA_TOKEN |
cargo |
test-rust, cargo-release | Cargo.toml | TOKEN, GITEA_TOKEN |
go |
test-go, go-release | go.mod | TOKEN, GITEA_TOKEN |
Warnings
⚠️ Removes all existing git remotes
⚠️ Requires remote repo to exist in Gitea before pushing
⚠️ Docker workflows need root Dockerfile
⚠️ Secrets must be configured in Gitea before workflows work
After Running
- Create remote repo in Gitea:
https://git.theprivateserver.de/{owner}/{repo} - If push failed, run manually:
git push -u origin main git push -u origin dev - Configure secrets in Gitea user/org settings
- Add Dockerfile if using
--deploy-type docker
Troubleshooting
| Issue | Solution |
|---|---|
| "PyYAML is required" | uv add pyyaml or pip install pyyaml |
| "owner and name are required" | Add to config or pass as CLI args |
| "Could not push to remote" | Create repo in Gitea first, then push manually |
| "Docker workflows require Dockerfile" | Add Dockerfile to repo root |
Files Created
.gitea/
changelog_config.json
workflows/
test-python.yml
test-rust.yml
test-go.yml
test-*-docker-build.yml
*-release.yml
.gitignore (if enabled)
LICENSE (if missing or --force)
Documentation
README.md- Full usage guideBUILD.md- Build instructionsEXAMPLES.md- Usage examplesSTATUS.md- Implementation statusSUMMARY.md- Implementation overviewQUICKREF.md- This file
Links
- Licenses:
licenses/MIT.txt,GPL-3.0.txt,AGPL-3.0.txt,Unlicense.txt - Python:
python/main.py - Rust:
rust/src/main.rs - Go:
go/main.go