Git & Repositories
Git & Repositories
Section titled “Git & Repositories”Sencai includes a built-in Git hosting service powered by Gitea — a self-hosted, open-source Git platform. Every organisation gets its own isolated namespace where repositories, packages, and CI pipelines live.
What is Git Integration in Sencai?
Section titled “What is Git Integration in Sencai?”- Organisation-scoped — Repositories belong to an organisation, not individual users. Every member of the organisation can access them according to their role.
- Self-hosted — Your code stays on Sencai’s infrastructure (or your own, if you use BYOC). Nothing is shared with third-party Git hosts.
- CI/CD ready — Gitea Actions (GitHub Actions-compatible) runs pipelines directly from your workflow files.
Viewing Repositories
Section titled “Viewing Repositories”Navigate to Gravity → Git (/gravity/git) to see a list of all repositories in the currently selected organisation.
Use the organisation selector in the header to switch between organisations. The repository list updates automatically.
Creating a Repository
Section titled “Creating a Repository”- Open Gravity → Git
- Click New repository
- Fill in the details:
- Name — Repository slug (lowercase, hyphens allowed; e.g.
my-service) - Description (optional) — Short description shown in the repository list
- Visibility —
Private(only org members) orPublic - Auto-initialize — Creates an initial commit with a
README.mdso the repository is immediately cloneable
- Name — Repository slug (lowercase, hyphens allowed; e.g.
- Click Create repository
The repository appears in the list within seconds and is ready for git clone.
Deleting a Repository
Section titled “Deleting a Repository”- Open the repository
- Go to the Settings tab
- Scroll to Danger zone
- Click Delete this repository
- Type the full repository name to confirm
- Click I understand, delete this repository
Repository Detail
Section titled “Repository Detail”Each repository has six tabs:
Overview
Section titled “Overview”The landing page for a repository. Shows:
-
Description and optional website link
-
Clone URL — copy the HTTP or SSH URL to clone locally:
Terminal window # HTTP (production)git clone https://git.sencai.space/acme-corp/my-service.git# SSH (production, port 22)git clone git@git.sencai.space:acme-corp/my-service.git -
Topics — tags for discoverability
-
Meta — last push time, star count, fork count, language breakdown
Browse the repository file tree at any branch or tag. Click any file to preview its contents inline. Supported previews include Markdown, JSON, YAML, and most source code files.
The Open in VS Code button (shown on file and directory views) launches VS Code with the repository URL pre-filled via the vscode:// URI scheme. Requires the VS Code remote extension to be installed locally.
Commits
Section titled “Commits”Full commit history for the current branch. Each entry shows:
- Commit message and short SHA
- Author name and avatar
- Relative and absolute timestamp
Click a commit SHA to see the full diff.
Issues
Section titled “Issues”A lightweight issue tracker scoped to the repository.
- Use the Open / Closed filter to switch views
- Click New issue to create an issue with a title, description, and optional labels
- Issues can be referenced from commit messages using
#<number>syntax
Packages
Section titled “Packages”Gitea doubles as a package registry. Packages published into this repository’s namespace appear here:
| Type | Example |
|---|---|
| Container (OCI) | Docker images via docker push |
| npm | npm publish --registry ... |
| PyPI | pip install --index-url ... |
| Helm | Helm chart repository |
| Generic | Binary artifacts via curl upload |
See the Gitea package registry documentation for per-type publish commands.
Settings
Section titled “Settings”Repository settings (available to organisation owners and repository admins):
General
- Rename the repository
- Update description and website
- Change visibility (private ↔ public)
- Enable or disable the Issues tracker
Deploy Keys Read-only or read-write SSH keys for automated deployments (CI runners, servers). Unlike user SSH keys, deploy keys are scoped to a single repository.
Webhooks Configure outbound HTTP webhooks triggered by push, pull request, issue, or release events. Useful for connecting external services.
Secrets & Variables Repository-level secrets and variables consumed by Gitea Actions workflows:
- Secrets — Encrypted values accessible as
${{ secrets.MY_SECRET }}in workflows - Variables — Plain-text values accessible as
${{ vars.MY_VAR }}in workflows
Mirror Repositories
Section titled “Mirror Repositories”Mirrors let you track an external Git repository and pull updates automatically on a schedule.
Navigate to Gravity → Git → Mirrors (/gravity/git/mirrors) to manage mirrors for the current organisation.
Adding a Mirror
Section titled “Adding a Mirror”- Click Add mirror
- Fill in:
- Remote URL — The upstream repository URL (HTTPS recommended; e.g.
https://github.com/acme/upstream.git) - Name — Local repository name that will be created in your organisation
- Auth token (optional) — Personal access token for private upstream repositories
- Sync interval — How often to pull changes:
- 8 hours
- 24 hours (default)
- 72 hours
- 168 hours (weekly)
- Remote URL — The upstream repository URL (HTTPS recommended; e.g.
- Click Create mirror
Gitea pulls the remote on the chosen interval and keeps the local copy in sync. You can also trigger a manual sync from the repository’s Settings → Mirror section.
Deleting a Mirror
Section titled “Deleting a Mirror”- Open Gravity → Git → Mirrors
- Find the mirror in the list
- Click the Delete icon
- Confirm the deletion
The local copy of the repository is removed from your organisation. The upstream source is not affected.
CI / Pipelines
Section titled “CI / Pipelines”Navigate to Gravity → Git → CI (/gravity/git/ci) for an overview of all Gitea Actions workflow runs across the organisation.
Each run shows:
- Repository and workflow name
- Trigger event (push, pull request, schedule, manual)
- Status: success, failure, or running
- Timestamp and duration
Click a run to see per-job logs.
Writing Workflow Files
Section titled “Writing Workflow Files”Gitea Actions uses the same YAML syntax as GitHub Actions. Sencai’s Gitea is configured to look for workflow files in these directories (checked in order):
.sencai/workflows/— recommended (Sencai-native path).gitea/workflows/.github/workflows/
Minimal example
Section titled “Minimal example”Create .sencai/workflows/ci.yml in your repository:
name: CI
on: push: branches: [main] pull_request:
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install run: npm ci - name: Test run: npm testPush the file to trigger the first run. Status appears in the CI tab and in Gravity → Git → CI.
Troubleshooting
Section titled “Troubleshooting”Q: Clone fails with “Repository not found”
A: Verify you are using the correct organisation name and repository slug. Check that you are a member of the organisation and that the repository is not set to a visibility you cannot access.
Q: SSH clone fails with “Permission denied (publickey)”
A: Make sure you have added your SSH public key to your Sencai account under Account Settings → SSH Keys. Test connectivity with ssh -T git@git.sencai.space in production, or ssh -T -p 9033 git@localhost in local development.
Q: Workflow is queued but never starts
A: No runner is available for the runs-on label in your workflow. Ask your administrator to check the registered runners in the Gitea admin panel.
Q: Mirror is not updating
A: The upstream URL may be unavailable or the auth token may have expired. Go to the repository Settings → Mirror and trigger a manual sync to see the error message.
Q: “Open in VS Code” does nothing
A: Make sure VS Code is installed and the Remote Repositories extension (or Remote — SSH) is active. The vscode:// URI scheme must be registered in your browser.