git server — your code repositories on this device
NanumOS keeps git repositories. The git on another computer pushes to this device and clones or fetches from it.
What it is
Think of it as a safe for code. Work from several computers comes together in one place (this device), with the whole history of who changed what and when. The gitd program on this device guards the door: only a name and password that match get in.
What to do now: follow the four steps under "How to use it" once, and git clone works from another computer.
How to use it
1. Make a repository
In the Terminal:
2. Make users
It asks for the password (8 characters or more, not shown). The permission is one of three.
| Permission | What it allows |
|---|---|
read | Getting only (clone, fetch) |
write | Getting + pushing: pushes that move a branch forward, new branches and tags, deleting a branch |
force | write + pushes that rewrite history (git push --force) and moving an existing tag |
To remove a user, write - as the permission. The file keeps an Argon2id fingerprint, never the password.
3. Turn it on (a service)
4. From another computer
git clone http://mina@this-device-address/myproject.git
git push origin main
The address is ip= in net status. git asks for the password.
5. Over SSH (a key instead of a password)
An SSH key works too. This device's sshd must be on (the "SSH" chapter; it can run as a service).
- Git-only keys: a key you give someone else is added for git alone. It gets no shell and no other command.
The permissions are those of the table above (read · write · force, - removes). A new key works from the next connection.
6. Working on the web (the forge)
Open http://DEVICE/ in a browser and sign in with the same name and password as for git. You see the list of repositories; a repository shows its files, commits, branches and tags (Korean file names and old EUC-KR text files show right).
- New repository: the button on the list (needs
write). - Merge request: push a branch, open Merge requests › New merge request, pick the branch and where it goes. The page shows the commits, the changed lines, comments and the check results. Merge moves the target forward (fast-forward) or makes a merge commit; when both sides changed the same lines, it says which files and changes nothing.
- Issues: a title, text, labels (
bug, ui), comments, close and reopen. Anyone who may read can open one. - Settings › Protected: on a protected branch only
forceusers may push directly; others merge through a merge request. No force pushes, no deletes. - Settings › Required check: merging waits until the check (e.g.
- Settings › Webhooks: after a push or a merge, a small JSON message goes to an
http://address you give, signed with your secret. - Your name (top right): SSH keys for git over ssh, and access tokens. A token is used instead of the password (
git clone http://me:TOKEN@DEVICE/app.git);readtokens only read.
The language follows the browser (Korean or English); the link at the top switches it.
How it works
One push goes like this.
- git sends what changed as one bundle (a pack). gitd does not put it in at once: it waits in a waiting room.
- In the waiting room every piece is unpacked and its fingerprint computed again, every difference between pieces (a delta) is worked out, and every commit, tree and tag is checked for its shape. A piece whose fingerprint is already stored must have exactly the same content.
- Everything a new branch tip leads to must be there. If one piece is missing, the push is not taken.
- The checked bundle moves into the repository, and last the file of branches is replaced as a whole. Only after the save has reached the disk does gitd tell git "done".
Two pushes into one repository go in one after the other, and when two people move the same branch at once, only the first is taken and the other is told to fetch first (the branch never tangles).
So if gitd dies or the power goes in the middle of a push, after a restart each branch is either where it was before the push or where the push put it, and the repository is whole. Every branch change adds a line to the reflog file: who, when, from what to what. Old commits a force push replaced are kept when the repository is tidied (gc).
A merge in the web works like a careful person at a desk with three copies of a file: the one both sides started from, yours and theirs. Lines only one side changed are taken from that side; lines both sides changed the same way are taken once; lines both changed differently stop the merge (a conflict) and nothing is written. The new merge commit and the branch move are saved the same way as a push.
Not yet
- Shallow clones (
git clone --depth) — this server gives whole history only. Such a request is refused with the reason. - Getting a part only (
--filter), push options, SHA-256 repositories. - Over SSH the protocol is v0 (the same content).
- One push is at most 256 MiB (split a bigger one). A repository whose packed size passes 256 MiB cannot be tidied into one pack (
gitd gc) on NanumOS. - The web: no line-by-line blame, no Markdown rendering (a README shows as text), no wiki, no releases, no organisations or per-repository members (the permission is per user, for every repository), no password change in the web (
gitd passwd), webhooks overhttp://only. - Sessions live in RAM: after a restart of the device everyone signs in again.
Technical details
- Forge (ZFORGE,
docs/contracts/ZFORGE.md): sessions (zfcookie, HttpOnly, SameSite=Lax;-Sadds Secure behind TLS) in/tmp/gitd-UID/s-*, a csrf value in every form, forms from another origin refused. Records:REPO/f/N(an issue or merge request),REPO/f/Nc(comments),REPO/f/settings,REPO/f/status;ROOT/.tokens(only a BLAKE2b hash of each token),ROOT/.profiles,ROOT/.ssh-keys. Webhooks: agitd hooksprocess sends the queue (/tmp/gitd-UID/hq-*) withX-Nanum-Signature: sha512=HMAC, 3 tries; the last deliveries show in the settings. - Web:
/list,/NAME/,/NAME/tree/PATH?r=BRANCH,/NAME/blob/…,/NAME/raw/…,/NAME/log,/NAME/commit/ID. Every page carriesContent-Security-Policy: default-src 'none'(repository content is shown, never run). - Protocol: git's smart HTTP. Getting: protocol v2 and v0 (multi_ack_detailed, side-band-64k, ofs-delta, thin-pack, include-tag); pushing: report-status, atomic, delete-refs, side-band-64k, thin packs. Request bodies: Content-Length, chunked, gzip.
- Storage: under
ROOT/REPO/:HEAD,refs(every branch in one file),reflog,p/(packs + pack index v2),o/(pushes of fewer than 100 pieces stay as single pieces). File names fit NanumOS's 31-byte name field. - On NanumOS the waiting room, the locks and the state file are in
/tmp/gitd-UID(never saved), and one push costs one save (sync). The home is saved whole in one go, so pieces, branches and reflog reach the disk together in that save. - Login: HTTP Basic + Argon2id (19 MiB, 2 passes). A password that matched is remembered in memory only while gitd runs. An address that is wrong 10 times in a minute is blocked for a minute.
- Check: the assistant's
os_checkhas a "git server" row (on, requests, pushes, refusals, last error). State file/tmp/gitd-UID/state.
NanumOS 0.1.8349 · 2026-11-16