layered-soul/skills/forgejo-operations/references/codeberg-host.md
Sam & Claude 4d8ce07fa7 docs: apply Prettier to current markdown (Sam & Codex)
Normalize markdown formatting after the latest main updates.\n\nChecks: python3 scripts/layered_soul.py validate .; npx --yes prettier@3 --check '**/*.md'; git diff --check.
2026-06-14 01:48:32 +02:00

2.7 KiB

Codeberg Host Reference

Codeberg is a Forgejo-based public git host at codeberg.org. Git operations are identical to self-hosted Forgejo, but the API is Forgejo, SSH key names differ, and discovery flows use git ls-remote instead of gh.

Prerequisites

SSH key must be added at https://codeberg.org/settings/keys. Test:

ssh -T git@codeberg.org
# Expected: "Hi there, <user>! You've successfully authenticated..."

No gh CLI — use pure git + ssh for everything.

Check What's Cloned Locally

When a project spans multiple repos, first survey what exists:

for d in /home/user/ai/*/; do
  if [ -d "$d/.git" ]; then
    echo "=== $d ==="
    git -C "$d" remote -v
  fi
done

Test Remote Repo Existence

git ls-remote git@codeberg.org:OrgName/RepoName.git HEAD

Clone

git clone git@codeberg.org:OrgName/RepoName.git /path/to/dest
git clone --depth 1 git@codeberg.org:OrgName/RepoName.git /path/to/dest  # shallow

Multi-Repo AGENTS.md Audit

After cloning, audit each repo's AGENTS.md for:

  • Agent identity table present
  • OS split documented (Dev host vs deploy target)
  • Cross-repo section lists all repos
  • Constraints match platform

Audit technique — scan for OS-specific terms:

from pathlib import Path
terms = ['FreeBSD', 'Linux', 'bastille', 'jail', 'pkg ', 'apt', 'systemd']
for term in terms:
    hits = []
    for path in Path(root).rglob('*'):
        if path.is_file() and '.git/' not in str(path):
            try:
                count = path.read_text(errors='ignore').lower().count(term.lower())
                if count > 0:
                    hits.append((str(path.relative_to(root)), count))
            except: pass
    if hits:
        print(f'  {term}: {sum(h[1] for h in hits)} hits in {len(hits)} files')

Fixing Stale Git Remotes

git remote -v
git remote remove origin-https
git remote set-url origin-https git@codeberg.org:OrgName/CorrectRepo.git

Shallow Clone Fixes (Codeberg-specific)

When unshallow via SSH times out, use HTTPS fallback:

git remote set-url origin https://codeberg.org/Org/Repo.git
git fetch --unshallow origin
git remote set-url origin git@codeberg.org:Org/Repo.git  # restore SSH

Quick Reference

Action Command
Test SSH auth ssh -T git@codeberg.org
Check repo exists git ls-remote git@codeberg.org:Org/Repo.git HEAD
Clone git clone git@codeberg.org:Org/Repo.git
Shallow clone git clone --depth 1 git@codeberg.org:Org/Repo.git