9<div class="row"> <div class="col-md-8">
11Urbit has its own revision-controlled filesystem, `%clay`. `%clay` is
12a typed, global, referentially transparent namespace. An easy way to
13think about it is like typed `git` with continuous sync.
15The most common way to use `%clay` is to mount a `%clay` node in a
16Unix directory. The Urbit process will watch this directory and
17automatically record edits as changes, Dropbox style. The mounted
18directory is always at the root of your pier directory.
24When developing it's a good idea to use a separate desk.
26Create a `%sandbox` desk based on the `%home` desk:
28 |merge %sandbox ~your-urbit %home
30Most of the time we want to use `%clay` from Unix.
32Mount the entire contents of your `sandbox` desk to Unix:
34 ~your-urbit:dojo> |mount /=sandbox=
36To explore the filesystem from inside Urbit `+ls` and `+cat` are
39 ~your-urbit:dojo> +ls /=sandbox=/web
41Let's see the contents of `/=sandbox=/web/md`:
43 ~your-urbit:dojo> +cat /=sandbox=/web/md
45Sync from your friend `~some-ship`'s `%experiment` desk to your
48 |sync %sandbox ~some-ship %experiment
52<h3 class="first child">Paths</h3>
54A path in `%clay` is a list of URL-safe text, restricted to `[a
55z]`,`[0 9]`, `.`, `-`, `_` and `~`. Formally this is a `(list knot)`
56where each segment is a `@ta`.
58Paths can be expressed as either `/foo/bar/baz` or `[%foo %bar %baz]`.
59The first three segments of an urbit path are `/plot/desk/case`, for
60example `/~doznec/home/1`.
64Relative paths are expressed using `%` which is roughly equivalent to
65Unix `.`. `%%` is `..` and `%%%` is what you would expect `...` to
66be. There are no local relative paths. `foo/bar` must be written
71If the default path is `/foo/bar/baz`, `/=/moo` means `/foo/moo`, and
72`/=/moo/=/goo` means `/foo/moo/baz/goo`. Also, instead of `/=/=/zoo`
73or `/=/=/=/voo`, write `/==zoo` or `/===voo`.
75Most commonly this is used to avoid having to know the current
76revision number in the `dojo`. Instead of writing
77`/~your-urbit/home/4/path/to/file` you can just write
78`/=home=/path/to/file`.
82<h3 class="first child"><code>|mount clay-path [unix-name]</code></h3>
84Mount the `clay-path` at the unix mount point `unix-name`.
90Mounts `%/web` to `/web` inside your pier directory.
92 |mount %/gen generators
94Mounts `%/gen` to `/generators` inside your pier directory.
96### `|unmount [clay-path || unix-name]`
98Unmount the path or name from Unix.
104Unmounts the path `%/web` from whatever name it was mounted as.
108Unmounts the Unix path `/generators`.
110### `|merge desk beak [strategy]`
112Merges a `beak` into a `desk` using an optional merge `strategy`.
114A `beak` is either a desk (`%home`), a plot-desk cell (`[~doznec
115%home]`), or a plot-desk-case (`/~doznec/home/2/web/md`)
119 |merge %home-work /=home= %fine
121Merge `/=home=` into `%home-work` using merge strategy `%fine`.
123 |merge %examples [~wacbex-ribmex %examples]
125Merge the `%examples` desk from `~waxbex-ribmex`
127### `|sync desk plot [plot-desk]`
129Subscribe to continuous updates from remote `plot` on local `desk`.
130`plot-desk` can specify the remote `desk` name. When omitted it's
131assumed to be the same as `desk`. Moons have `|sync %home ~parent
132%kids` automatically set up (where `~parent` is the planet that issued
137 |sync %home-local ~doznec %home |sync %home ~doznec
139### `|unsync desk plot [plot-desk]`
141Unsubscribe from updates from remote `plot` on local `desk` with
142optional `plot-desk`. Arguments must match original `|sync` command
147 |unsync %home-local ~doznec %home
149### `|label desk name`
151Label the current version of `desk` `name`.
159`%init` - Used if it's the first commit to a desk. Also can be
160used to "reinitialize" a desk -- revision numbers keep going up,
161but the new revision isn't necessarily a descendent of the
162previously-numbered version.
164`%this` - Keep what's in Bob's desk, but join the ancestry.
166`%that` - take what's in Alice's desk, but join the ancestry. This is
167the reverse of `%this`. This is different from `%init` because
168the new commit has both sides in its ancestry.
170`%fine` - "fast-forward" merge. This succeeds iff one head is in the
171ancestry of the other.
173`%meet`, `%mate`, and `%meld` - find the most recent common ancestor
174to use as our merge base.
176A `%meet` merge only succeeds if the changes from the merge base to
177Alice's head (hereafter, "Alice's changes") are in different files
178than Bob's changes. In this case, the parents are both Alice's and
179Bob's heads, and the data is the merge base plus Alice's changed files
180plus Bob's changed files.
182A `%mate` merge attempts to merge changes to the same file when both
183Alice and Bob change it. If the merge is clean, we use it; otherwise,
184we fail. A merge between different types of changes -- for example,
185deleting a file vs changing it -- is always a conflict. If we succeed,
186the parents are both Alice's and Bob's heads, and the data is the
187merge base plus Alice's changed files plus Bob's changed files plus
190A `%meld` merge will succeed even if there are conflicts. If there are
191conflicts in a file, then we use the merge base's version of that
192file, and we produce a set of files with conflicts. The parents are
193both Alice's and Bob's heads, and the data is the merge base plus
194Alice's changed files plus Bob's changed files plus the successfully
195merged files plus the merge base's version of the conflicting files.
197`%auto` - meta-strategy. Check to see if Bob's desk exists, and if it
198doesn't we use an `%init` merge. Otherwise, we progressively try
199`%fine`, `%meet`, and `%mate` until one succeeds. If none succeed, we
200merge Bob's desk into a scratch desk. Then, we merge Alice's desk
201into the scratch desk with the `%meld` option to force the merge.
202Finally, we annotate any conflicts, if we know how.
206<h3 class="first child"><code>|rm path</code></h3>
208Remove the data at `path`. `path` must be a path to actual node, not
213Copy the subtree `from` into the subtree `to`, committing it with the
214specified merge strategy `how`.
216#### `|mv to from how`
218Move the subtree `from` into the subtree `to`, committing it with the
219specified merge strategy `how`.
221In `%clay`, `|mv` is just a shorthand for `|cp` then `|rm`. The `|rm`
222doesn't happen unless the `|cp` succeeds.
226<h3 class="first child"><code>+cat path</code> / <code>+cal [path
229Similar to Unix `cat`. `+cat` takes a single `path`, `+cal` a list of
232Produces the contents of the file at the given `path`.
234### `+ls path` / `+ll [path ...]`
236Similar to Unix `ls`. `+ls` takes a single `path`, `+ll` a list of
239Produces a list of names at the `path`.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list