10<div class="row"> <div class="col-md-8">
12Urbit has its own revision-controlled filesystem, `%clay`. `%clay` is
13a typed, global, referentially transparent namespace. An easy way to
14think about it is like typed `git` with continuous sync.
16The most common way to use `%clay` is to mount a `%clay` node in a
17Unix directory. The Urbit process will watch this directory and
18automatically record edits as changes, Dropbox style. The mounted
19directory is always at the root of your pier directory.
25When developing it's a good idea to use a separate desk.
27Create a `%sandbox` desk based on the `%home` desk:
29 |merge %sandbox ~your-urbit %home
31Most of the time we want to use `%clay` from Unix.
33Mount the entire contents of your `sandbox` desk to Unix:
35 ~your-urbit:dojo> |mount /=sandbox=
37To explore the filesystem from inside Urbit `+ls` and `+cat` are
40 ~your-urbit:dojo> +ls /=sandbox=/web
42Let's see the contents of `/=sandbox=/web/md`:
44 ~your-urbit:dojo> +cat /=sandbox=/web/md
46Sync from your friend `~some-ship`'s `%experiment` desk to your
49 |sync %sandbox ~some-ship %experiment
53<h3 class="first child">Paths</h3>
55A path in `%clay` is a list of URL-safe text, restricted to `[a
56z]`,`[0 9]`, `.`, `-`, `_` and `~`. Formally this is a `(list knot)`
57where each segment is a `@ta`.
59Paths can be expressed as either `/foo/bar/baz` or `[%foo %bar %baz]`.
60The first three segments of an urbit path are `/plot/desk/case`, for
61example `/~doznec/home/1`.
65Relative paths are expressed using `%` which is roughly equivalent to
66Unix `.`. `%%` is `..` and `%%%` is what you would expect `...` to
67be. There are no local relative paths. `foo/bar` must be written
72If the default path is `/foo/bar/baz`, `/=/moo` means `/foo/moo`, and
73`/=/moo/=/goo` means `/foo/moo/baz/goo`. Also, instead of `/=/=/zoo`
74or `/=/=/=/voo`, write `/==zoo` or `/===voo`.
76Most commonly this is used to avoid having to know the current
77revision number in the `dojo`. Instead of writing
78`/~your-urbit/home/4/path/to/file` you can just write
79`/=home=/path/to/file`.
83<h3 class="first child"><code>|mount clay-path [unix-name]</code></h3>
85Mount the `clay-path` at the unix mount point `unix-name`.
91Mounts `%/web` to `/web` inside your pier directory.
93 |mount %/gen generators
95Mounts `%/gen` to `/generators` inside your pier directory.
97### `|unmount [clay-path || unix-name]`
99Unmount the path or name from Unix.
105Unmounts the path `%/web` from whatever name it was mounted as.
109Unmounts the Unix path `/generators`.
111### `|merge desk beak[, =gem strategy]`
113Merges a `beak` into a `desk` using an optional merge `strategy`.
115A `beak` is a ship-desk-case triple, encoded as a path(`/~doznec/home/2`)
119 |merge %home-work /=home=, =gem %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 is
131defaulted to being the same as `desk`. Non-comet urbits have `|sync
132%home ~parent %kids` automatically set up (where `~parent` is the
133planet that issued a moon, the star that issued a planet, or the
134galaxy that issued a star).
138 |sync %home-local ~doznec %home |sync %home ~doznec
140### `|unsync desk plot [plot-desk]`
142Unsubscribe from updates from remote `plot` on local `desk` with
143optional `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, allowing merges to be rerun.
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 file at `from` into the path `to`.
217Move the file at `from` into the path `to`.
219In `%clay`, `|mv` is just a shorthand for `|cp` then `|rm`. The `|rm`
220doesn't happen unless the `|cp` succeeds.
224<h3 class="first child"><code>+cat path [path ...]</code></h3>
226Similar to Unix `cat`. `+cat` takes one or more `path`s, and prints
231Similar to Unix `ls`. `+ls` takes a single `path`.
233Produces 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