NanumOS

git — the history of your code and writing

git records everything that changed in a folder: when, by whom, what. NanumOS's git uses the same repositories as git on other computers and exchanges them with servers such as GitHub or this device's git server (the "git server" chapter).

What it is

Like keeping every edition of a book. Each change leaves one edition, a "commit"; any time later you can look at an old edition, go back to it, or join it with someone else's.

What to do now: in the Terminal, get a repository with git clone ADDRESS. Or ask the assistant "what is the git status of this folder".

How to use it

Once: your name

Every commit carries this name.

Getting and making

git clone https://github.com/NAME/REPO.git
git init NEWFOLDER

Every day

git status              what changed
git add FILE            put it in the next commit (git add -A: everything)
git commit -m "what you changed"
git log --oneline       past commits
git diff                changed lines not committed yet
git pull                get the remote's new commits and join them
git push                send your commits

Branches: git switch -c NEW, git switch main, git merge NEW. When both sides changed the same lines, the file gets <<<<<<<, =======, >>>>>>> marks. Fix it, then git add FILE and git commit (give up: git merge --abort).

Going back: git reset --soft HEAD~1 (undo the commit only), git reset --hard HEAD (throw away uncommitted changes — they cannot be brought back).

Asking the assistant

How it works

  1. Each file's content is named by its fingerprint and kept in .git/objects. The same content is stored once.
  2. Folder shapes (trees) and "who, when, what" (commits) are stored the same way; each commit points at the one before, a chain.
  3. A branch is only a label on the end of a chain. A commit moves the label to the new commit.
  4. The order is always "contents → the list (index) → the label". So a power cut never breaks the repository: a commit is either whole or not made.
  5. Getting and sending move only the changed pieces as one bundle (a pack); a received bundle goes in only after every piece's fingerprint was computed again.

Common questions

Technical details
  • Transports: https (BearSSL) and http in protocol v2 (v0 when needed), ssh by starting the pack's ssh, and git://.
  • NanumOS repositories: the name field is 31 bytes, so single pieces are objects/XX/<31 base32> and packs p<24>.pack; the rest is git's own.
  • Check: the assistant's os_check "git" row = the last transfer's result (/tmp/git-UID/last, never saved).
  • Contract: docs/contracts/GIT.md.

NanumOS 0.1.8349 · 2026-11-16