9436bb75c3 2008-11-15 kejoki: <h2>add</h2> 9436bb75c3 2008-11-15 kejoki: 9436bb75c3 2008-11-15 kejoki: The often used <code>add</code> command is how you tell <b>fossil</b> to 9436bb75c3 2008-11-15 kejoki: include a (usually new) file in the repository. 9436bb75c3 2008-11-15 kejoki: 9436bb75c3 2008-11-15 kejoki: <b>fossil</b> is designed to manage artifacts whose role is being 9436bb75c3 2008-11-15 kejoki: "source" for something, most probably software program code or other 9436bb75c3 2008-11-15 kejoki: text. One can imagine all kinds of ways to let fossil know just what 9436bb75c3 2008-11-15 kejoki: constitutes a source; the simplest and most direct way it 9436bb75c3 2008-11-15 kejoki: <i>actually</i> finds out is when you give it the 83447b7bf1 2008-12-09 kejoki: <code> fossil add <i>path</i> </code> command. 9436bb75c3 2008-11-15 kejoki: 9436bb75c3 2008-11-15 kejoki: It's reasonable to think of 83447b7bf1 2008-12-09 kejoki: the [./cmd_import.wiki | <code>import</code>] 83447b7bf1 2008-12-09 kejoki: and [./cmd_clone.wiki | <code>clone</code>] 9436bb75c3 2008-11-15 kejoki: commands as very high-powered versions of the <code>add</code> 9436bb75c3 2008-11-15 kejoki: command that are combined with system level file movement and 9436bb75c3 2008-11-15 kejoki: networking functions. Not particularly accurate, but reasonable. 9436bb75c3 2008-11-15 kejoki: 83447b7bf1 2008-12-09 kejoki: Typing <code> fossil add myfile</code> causes fossil to put 9436bb75c3 2008-11-15 kejoki: <i>myfile</i> into the repository at the next 9436bb75c3 2008-11-15 kejoki: <code>commit</code>—provided you issue it from within the source 9436bb75c3 2008-11-15 kejoki: tree, of course. 9436bb75c3 2008-11-15 kejoki: 83447b7bf1 2008-12-09 kejoki: By contrast, <code> fossil add mydirectory</code> will add 83447b7bf1 2008-12-09 kejoki: <em><strong>all</strong></em> of the files in <i>mydirectory</i>, and 83447b7bf1 2008-12-09 kejoki: all of its sub-directories. In other words, adding a directory will 83447b7bf1 2008-12-09 kejoki: recursively add all of the directory's file system descendants to the 83447b7bf1 2008-12-09 kejoki: repository. This was an oft-requested feature, recently implemented. 83447b7bf1 2008-12-09 kejoki: It is very flexible. Only when you add a directory do you get the 83447b7bf1 2008-12-09 kejoki: recursive behavior. If you are globbing a subset of files, you won't 83447b7bf1 2008-12-09 kejoki: get the recursion. 83447b7bf1 2008-12-09 kejoki: 83447b7bf1 2008-12-09 kejoki: Realize that the repository is <u>not</u> changed by the 83447b7bf1 2008-12-09 kejoki: <code>add</code> command, but by the <code> commit</code> command. 83447b7bf1 2008-12-09 kejoki: <code>add</code> <i>myfile</i> tells <b>fossil</b> to "mark" 83447b7bf1 2008-12-09 kejoki: <i>myfile</i> as part of the repository. Only commands which actually 83447b7bf1 2008-12-09 kejoki: manipulate the content of the repository can physically put source 83447b7bf1 2008-12-09 kejoki: artifacts into (or remove them from) the repository. 9436bb75c3 2008-11-15 kejoki: 83447b7bf1 2008-12-09 kejoki: Just to keep things symmetric, there are also commands that can 9436bb75c3 2008-11-15 kejoki: manipulate the repository without affecting the checked-out sources 83447b7bf1 2008-12-09 kejoki: (see [./cmd_pull.wiki | fossil pull], for instance.) 83447b7bf1 2008-12-09 kejoki: 83447b7bf1 2008-12-09 kejoki: It's worthwhile reiterating that <b>fossil</b> is storing the content 83447b7bf1 2008-12-09 kejoki: of source artifacts and the names of the artifacts in their "native 83447b7bf1 2008-12-09 kejoki: habitat", a sequence of "temporal slices" (aka "versions") of the 83447b7bf1 2008-12-09 kejoki: state of the whole system, and a set of unique identifiers. When you 83447b7bf1 2008-12-09 kejoki: add a file to a repository, the <i>path</i> to the file is a part of 83447b7bf1 2008-12-09 kejoki: the <i>name</i> of the file. There is a mis-match between the file 83447b7bf1 2008-12-09 kejoki: system's idea of a directory (a file containing pointers to files) and 83447b7bf1 2008-12-09 kejoki: fossil's idea (a substring of the name of the artifact.) The names of 83447b7bf1 2008-12-09 kejoki: the artifacts specify their relative locations because of the way the 83447b7bf1 2008-12-09 kejoki: file system interprets them. If you don't keep this in mind, you may 83447b7bf1 2008-12-09 kejoki: fool yourself into thinking <b>fossil</b> somehow "stores 83447b7bf1 2008-12-09 kejoki: directories." It doesn't, and believing it does will eventually 83447b7bf1 2008-12-09 kejoki: confuse you. 9436bb75c3 2008-11-15 kejoki: 83447b7bf1 2008-12-09 kejoki: See also: [./cmd_rm.wiki | fossil rm], 83447b7bf1 2008-12-09 kejoki: [./cmd_import.wiki | fossil import], 83447b7bf1 2008-12-09 kejoki: [./cmd_clone.wiki | fossil clone], 83447b7bf1 2008-12-09 kejoki: [./cmd_commit.wiki | fossil commit], 83447b7bf1 2008-12-09 kejoki: [./cmd_pull.wiki | fossil pull], 83447b7bf1 2008-12-09 kejoki: [./cmd_settings.wiki | fossil setting] (async), 83447b7bf1 2008-12-09 kejoki: [./reference.wiki | Reference]