Research for ops-jrz1-mh2: how dev users collaborate on git.clarun.xyz Covers: - Account setup and SSH access - Shared repo vs fork+PR models - Trunk-based workflow - Troubleshooting common issues
4 KiB
Forgejo Collaboration Guide
How dev users collaborate on shared projects via git.clarun.xyz.
Overview
Forgejo is our self-hosted git server at https://git.clarun.xyz. Dev users get automatic accounts when provisioned via dev-add.sh.
Getting Started
Your Account
When your account is created, you automatically get:
- Forgejo username matching your Unix username
- SSH access from both your laptop and the dev server
- Initial password in
~/.forgejo-credentials(change on first login)
Clone a Repository
# From the dev server (or laptop with SSH key registered)
git clone forgejo@git.clarun.xyz:owner/repo.git
Note: The SSH user is
forgejo, notgit.
Web Interface
Browse repos, manage settings, view history: https://git.clarun.xyz
Collaboration Models
Shared Repository (Small Teams)
All collaborators have write access to the same repo.
Setup:
- Repo owner adds collaborators via web UI (Settings → Collaborators)
- Everyone clones the same repo
- Use branches for features, merge to main
Best for: Trusted teams, internal projects, rapid iteration
Fork + Pull Request (Open Contribution)
Contributors work on personal forks and submit PRs.
Setup:
- Fork the repo via web UI
- Clone your fork
- Push changes to your fork
- Create Pull Request to upstream
Best for: External contributors, code review gates, open source style
Recommended Workflow
We use trunk-based development:
main (always deployable)
│
├── feature-branch (short-lived)
│ └── merge back quickly
│
└── another-feature
Daily Workflow
# Start fresh
git checkout main
git pull
# Create feature branch
git checkout -b add-new-feature
# Make changes, commit often
git add .
git commit -m "Add new feature"
# Push and create PR (or merge directly for small teams)
git push -u origin add-new-feature
Commit Messages
Keep them clear and concise:
- ~70 characters for the summary line
- Reference issue IDs if applicable
- No emojis or marketing language
Repository Settings
Creating a New Repo
Via Web UI:
- Click "+" → "New Repository"
- Choose owner (you or an organization)
- Set visibility (public/private)
Via API (admins):
TOKEN=$(cat /run/secrets/forgejo-api-token)
curl -X POST "http://localhost:3000/api/v1/user/repos" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "my-project", "private": false}'
Adding Collaborators
- Go to repo → Settings → Collaborators
- Search by username
- Choose permission level (Read, Write, Admin)
SSH Configuration
From Your Laptop
Add to ~/.ssh/config:
Host git.clarun.xyz
HostName git.clarun.xyz
User forgejo
IdentityFile ~/.ssh/id_ed25519
Then clone with:
git clone git.clarun.xyz:owner/repo.git
From the Dev Server
SSH keys are pre-configured. Just clone:
git clone forgejo@git.clarun.xyz:owner/repo.git
Troubleshooting
"Permission denied (publickey)"
Your SSH key isn't registered in Forgejo.
Fix:
- Go to https://git.clarun.xyz/user/settings/keys
- Add your public key (
cat ~/.ssh/id_ed25519.pub)
"Repository not found"
Either the repo doesn't exist or you don't have access.
Fix:
- Check the URL spelling
- Ask the repo owner to add you as a collaborator
- For private repos, ensure you're authenticated
Clone works but push fails
You have read access but not write access.
Fix: Ask repo owner to grant Write permission in Collaborators settings.
Best Practices
- Pull before starting work - Avoid merge conflicts
- Small, focused commits - Easier to review and revert
- Use branches - Keep main deployable
- Write good commit messages - Future you will thank you
- Don't commit secrets - Use environment variables or secret management
Related Docs
- Dev Onboarding - Full setup guide
- Forgejo Admin - API tokens and admin operations