NanumOS

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.

PermissionWhat it allows
readGetting only (clone, fetch)
writeGetting + pushing: pushes that move a branch forward, new branches and tags, deleting a branch
forcewrite + 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).

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).

The language follows the browser (Korean or English); the link at the top switches it.

How it works

One push goes like this.

  1. git sends what changed as one bundle (a pack). gitd does not put it in at once: it waits in a waiting room.
  2. 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.
  3. Everything a new branch tip leads to must be there. If one piece is missing, the push is not taken.
  4. 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

Technical details
  • Forge (ZFORGE, docs/contracts/ZFORGE.md): sessions (zf cookie, HttpOnly, SameSite=Lax; -S adds 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: a gitd hooks process sends the queue (/tmp/gitd-UID/hq-*) with X-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 carries Content-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_check has a "git server" row (on, requests, pushes, refusals, last error). State file /tmp/gitd-UID/state.

NanumOS 0.1.8349 · 2026-11-16