Fossil SCM
Add examples and expand on the workflow
Commit
3e44368b6c8a0b05f3e0f12aeae17587ebd21c5c86c7f5dfc3446fb7134fa82f
Parent
e299531d5b45060…
1 file changed
+141
-13
+141
-13
| --- www/quickstart.wiki | ||
| +++ www/quickstart.wiki | ||
| @@ -1,26 +1,34 @@ | ||
| 1 | 1 | <title>Fossil Quick Start Guide</title> |
| 2 | 2 | <h1 align="center">Fossil Quick Start</h1> |
| 3 | 3 | |
| 4 | -<p>This is a guide to help you get started using Fossil quickly | |
| 4 | +<p>This is a guide to help you get started using the Fossil [https://en.wikipedia.org/wiki/Distributed_version_control|Distributed Version Control System] quickly | |
| 5 | 5 | and painlessly.</p> |
| 6 | 6 | |
| 7 | 7 | <h2 id="install">Installing</h2> |
| 8 | 8 | |
| 9 | 9 | <p>Fossil is a single self-contained C program. You need to |
| 10 | 10 | either download a |
| 11 | - <a href="https://www.fossil-scm.org/fossil/uv/download.html">precompiled | |
| 12 | - binary</a> | |
| 11 | + [https://www.fossil-scm.org/fossil/uv/download.html|precompiled | |
| 12 | + binary] | |
| 13 | 13 | or <a href="build.wiki">compile it yourself</a> from sources. |
| 14 | 14 | Install Fossil by putting the fossil binary |
| 15 | 15 | someplace on your $PATH.</p> |
| 16 | + You can test that Fossil is present and working like this: | |
| 17 | + | |
| 18 | + <blockquote> | |
| 19 | + <b> | |
| 20 | + fossil version<br> | |
| 21 | + This is fossil version 2.13 [309af345ab] 2020-09-28 04:02:55 UTC<br> | |
| 22 | + </b> | |
| 23 | + </blockquote> | |
| 16 | 24 | |
| 17 | 25 | <h2 id="workflow" name="fslclone">General Work Flow</h2> |
| 18 | 26 | |
| 19 | - <p>Fossil works with repository files (a database with the project's | |
| 27 | + <p>Fossil works with repository files (a database in a single file with the project's | |
| 20 | 28 | complete history) and with checked-out local trees (the working directory |
| 21 | - you use to do your work). | |
| 29 | + you use to do your work). | |
| 22 | 30 | (See [./whyusefossil.wiki#definitions | definitions] for more background.) |
| 23 | 31 | The workflow looks like this:</p> |
| 24 | 32 | |
| 25 | 33 | <ul> |
| 26 | 34 | <li>Create or clone a repository file. ([/help/init|fossil init] or |
| @@ -27,10 +35,13 @@ | ||
| 27 | 35 | [/help/clone | fossil clone]) |
| 28 | 36 | <li>Check out a local tree. ([/help/open | fossil open]) |
| 29 | 37 | <li>Perform operations on the repository (including repository |
| 30 | 38 | configuration). |
| 31 | 39 | </ul> |
| 40 | + | |
| 41 | + Fossil can be entirely driven from the command line, while many features | |
| 42 | + can also be conveniently accessed from the build-in web interface. | |
| 32 | 43 | |
| 33 | 44 | <p>The following sections will give you a brief overview of these |
| 34 | 45 | operations.</p> |
| 35 | 46 | |
| 36 | 47 | <h2 id="new">Starting A New Project</h2> |
| @@ -39,10 +50,14 @@ | ||
| 39 | 50 | this way: ([/help/init | more info]) </p> |
| 40 | 51 | |
| 41 | 52 | <blockquote> |
| 42 | 53 | <b>fossil init </b><i> repository-filename</i> |
| 43 | 54 | </blockquote> |
| 55 | + | |
| 56 | + You can name the database anything you like, and you can place it anywhere in the filesystem. | |
| 57 | + The <tt>.fossil</tt> extension is traditional but only required if you are going to use the | |
| 58 | + <tt>[./help?cmd=/server | fossil server DIRECTORY]</tt> feature.” | |
| 44 | 59 | |
| 45 | 60 | <h2 id="clone">Cloning An Existing Repository</h2> |
| 46 | 61 | |
| 47 | 62 | <p>Most fossil operations interact with a repository that is on the |
| 48 | 63 | local disk drive, not on a remote system. Hence, before accessing |
| @@ -57,46 +72,72 @@ | ||
| 57 | 72 | </blockquote> |
| 58 | 73 | |
| 59 | 74 | <p>The <i>URL</i> specifies the fossil repository |
| 60 | 75 | you want to clone. The <i>repository-filename</i> is the new local |
| 61 | 76 | filename into which the cloned repository will be written. For |
| 62 | - example: | |
| 77 | + example, to clone the source code of Fossil itself: | |
| 78 | + | |
| 79 | + <blockquote> | |
| 80 | + <b>fossil clone https://www.fossil-scm.org/ myclone.fossil</b> | |
| 81 | + </blockquote> | |
| 82 | + | |
| 83 | + If your logged-in username is 'exampleuser', you should see output something like this: | |
| 63 | 84 | |
| 64 | 85 | <blockquote> |
| 65 | - <b>fossil clone http://www.fossil-scm.org/ myclone.fossil</b> | |
| 86 | + <b> | |
| 87 | + Round-trips: 8 Artifacts sent: 0 received: 39421<br> | |
| 88 | + Clone done, sent: 2424 received: 42965725 ip: 10.10.10.0<br> | |
| 89 | + Rebuilding repository meta-data...<br> | |
| 90 | + 100% complete...<br> | |
| 91 | + Extra delta compression... <br> | |
| 92 | + Vacuuming the database... <br> | |
| 93 | + project-id: 94259BB9F186226D80E49D1FA2DB29F935CCA0333<br> | |
| 94 | + server-id: 016595e9043054038a9ea9bc526d7f33f7ac0e42<br> | |
| 95 | + admin-user: exampleuser (password is "yoWgDR42iv")><br> | |
| 96 | + </b> | |
| 66 | 97 | </blockquote> |
| 67 | 98 | |
| 68 | 99 | <p>If the remote repository requires a login, include a |
| 69 | 100 | userid in the URL like this: |
| 70 | 101 | |
| 71 | 102 | <blockquote> |
| 72 | - <b>fossil clone http://</b><i>userid</i><b>@www.fossil-scm.org/ myclone.fossil</b> | |
| 103 | + <b>fossil clone https://</b><i>remoteuserid</i><b>@www.example.org/ myclone.fossil</b> | |
| 73 | 104 | </blockquote> |
| 74 | - | |
| 75 | 105 | |
| 76 | 106 | <p>You will be prompted separately for the password. |
| 77 | - Use "%HH" escapes for special characters in the userid. | |
| 78 | - Examples: "%40" in place of "@" and "%2F" in place of "/". | |
| 107 | + Use [https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters|"%HH"] escapes for special characters in the userid. | |
| 108 | + For example "/" would be replaced by "%2F" meaning that a userid of "Projects/Budget" would become "Projects%2FBudget") </p> | |
| 79 | 109 | |
| 80 | 110 | <p>If you are behind a restrictive firewall, you might need |
| 81 | 111 | to <a href="#proxy">specify an HTTP proxy</a>.</p> |
| 82 | 112 | |
| 83 | 113 | <p>A Fossil repository is a single disk file. Instead of cloning, |
| 84 | 114 | you can just make a copy of the repository file (for example, using |
| 85 | 115 | "scp"). Note, however, that the repository file contains auxiliary |
| 86 | 116 | information above and beyond the versioned files, including some |
| 87 | 117 | sensitive information such as password hashes and email addresses. If you |
| 88 | - want to share Fossil repositories directly, consider running the | |
| 118 | + want to share Fossil repositories directly by copying, consider running the | |
| 89 | 119 | [/help/scrub|fossil scrub] command to remove sensitive information |
| 90 | 120 | before transmitting the file. |
| 91 | 121 | |
| 92 | 122 | <h2 id="import">Importing From Another Version Control System</h2> |
| 93 | 123 | |
| 94 | 124 | <p>Rather than start a new project, or clone an existing Fossil project, |
| 95 | 125 | you might prefer to |
| 96 | 126 | <a href="./inout.wiki">import an existing Git project</a> |
| 97 | - into Fossil using the [/help/import | fossil import] command. | |
| 127 | + into Fossil using the [/help/import | fossil import] command. | |
| 128 | + | |
| 129 | + You can even decide to export your project back into git using the | |
| 130 | + [/help/git | fossil git] command, which is how the Fossil project maintains | |
| 131 | + [https://github.com/drhsqlite/fossil-mirror | its public GitHub mirror]. There | |
| 132 | + is no limit to the number of times a tree can be imported and exported between | |
| 133 | + Fossil and git. | |
| 134 | + | |
| 135 | + The [https://git-scm.com/docs/git-fast-export|Git fast-export format] has become | |
| 136 | + a popular way to move files between version management systems, including from | |
| 137 | + [https://www.mercurial-scm.org/|Mercurial]. | |
| 138 | + Fossil can also import [https://subversion.apache.org/|Subversion projects] directly. | |
| 98 | 139 | |
| 99 | 140 | <h2 id="checkout">Checking Out A Local Tree</h2> |
| 100 | 141 | |
| 101 | 142 | <p>To work on a project in fossil, you need to check out a local |
| 102 | 143 | copy of the source tree. Create the directory you want to be |
| @@ -105,10 +146,24 @@ | ||
| 105 | 146 | |
| 106 | 147 | <blockquote> |
| 107 | 148 | <b>fossil open </b><i> repository-filename</i> |
| 108 | 149 | </blockquote> |
| 109 | 150 | |
| 151 | + for example: | |
| 152 | + | |
| 153 | + <blockquote> | |
| 154 | + <b> | |
| 155 | + fossil open ../myclone.fossil<br> | |
| 156 | + BUILD.txt<br> | |
| 157 | + COPYRIGHT-BSD2.txt<br> | |
| 158 | + README.md<br> | |
| 159 | + ︙<br> | |
| 160 | + </b> | |
| 161 | + </blockquote> | |
| 162 | + | |
| 163 | + (or "fossil open ..\myclone.fossil" on Windows). | |
| 164 | + | |
| 110 | 165 | <p>This leaves you with the newest version of the tree |
| 111 | 166 | checked out. |
| 112 | 167 | From anywhere underneath the root of your local tree, you |
| 113 | 168 | can type commands like the following to find out the status of |
| 114 | 169 | your local tree:</p> |
| @@ -120,10 +175,13 @@ | ||
| 120 | 175 | <b>[/help/diff | fossil diff]</b><br> |
| 121 | 176 | <b>[/help/timeline | fossil timeline]</b><br> |
| 122 | 177 | <b>[/help/ls | fossil ls]</b><br> |
| 123 | 178 | <b>[/help/branch | fossil branch]</b><br> |
| 124 | 179 | </blockquote> |
| 180 | + | |
| 181 | + <p>If you created a new respository using "fossil init" then some commands will not | |
| 182 | + produce much output.</p> | |
| 125 | 183 | |
| 126 | 184 | <p>Note that Fossil allows you to make multiple check-outs in |
| 127 | 185 | separate directories from the same repository. This enables you, |
| 128 | 186 | for example, to do builds from multiple branches or versions at |
| 129 | 187 | the same time without having to generate extra clones.</p> |
| @@ -140,10 +198,80 @@ | ||
| 140 | 198 | does a "soft" switch, merging any local changes into the target |
| 141 | 199 | version, whereas [/help/checkout | checkout] does not |
| 142 | 200 | automatically sync and does a "hard" switch, overwriting local |
| 143 | 201 | changes if told to do so.</p> |
| 144 | 202 | |
| 203 | +<h2 id="changes">Making and Commiting Changes</h2> | |
| 204 | + | |
| 205 | + <p>To add new files to your project or remove existing ones, use these | |
| 206 | + commands:</p> | |
| 207 | + | |
| 208 | + <blockquote> | |
| 209 | + <b>[/help/add | fossil add]</b> <i>file...</i><br> | |
| 210 | + <b>[/help/rm | fossil rm]</b> <i>file...</i><br> | |
| 211 | + <b>[/help/addremove | fossil addremove]</b> <i>file...</i><br> | |
| 212 | + </blockquote> | |
| 213 | + | |
| 214 | + <p>The command:</p> | |
| 215 | + <blockquote> | |
| 216 | + <b> | |
| 217 | + [/help/changes | fossil changes]</b> | |
| 218 | + </blockquote> | |
| 219 | + <p>lists files that have changed since the last commit to the repository. For | |
| 220 | + example, if you edit the file "README.md":</p> | |
| 221 | + | |
| 222 | + <blockquote> | |
| 223 | + <b> | |
| 224 | + fossil changes<br> | |
| 225 | + EDITED README.md | |
| 226 | + </b> | |
| 227 | + </blockquote> | |
| 228 | + | |
| 229 | + <p>To see exactly what change was made you can use the command</p> | |
| 230 | + [/help/diff | fossil diff]: | |
| 231 | + <blockquote> | |
| 232 | + <b> | |
| 233 | + fossil diff <br> | |
| 234 | + Index: README.md<br> | |
| 235 | + ============================================================<br> | |
| 236 | + --- README.md<br> | |
| 237 | + +++ README.md<br> | |
| 238 | + @@ -1,5 +1,6 @@<br> | |
| 239 | + +I made a change<br> | |
| 240 | + # Original text<br> | |
| 241 | + </b> | |
| 242 | + </blockquote> | |
| 243 | + | |
| 244 | + <p>"fossil diff" is the difference between your tree on disk now and as it was | |
| 245 | + when you did "fossil open". An open is the first checkout from a repository | |
| 246 | + into a new directory. </p> | |
| 247 | + | |
| 248 | + <p>To commit your changes to a local-only repository:</p> | |
| 249 | + <blockquote> | |
| 250 | + <b> | |
| 251 | + fossil commit (... Fossil will start your editor, if defined)<br> | |
| 252 | + # Enter a commit message for this check-in. Lines beginning with # are ignored.<br> | |
| 253 | + #<br> | |
| 254 | + # user: exampleuser<br> | |
| 255 | + # tags: trunk<br> | |
| 256 | + #<br> | |
| 257 | + # EDITED README.md<br> | |
| 258 | + Edited file to add description of code changes<br> | |
| 259 | + New_Version: 7b9a416ced4a69a60589dde1aedd1a30fde8eec3528d265dbeed5135530440ab<br> | |
| 260 | + </b> | |
| 261 | + </blockquote> | |
| 262 | + | |
| 263 | + <p>You will be prompted for check-in comments using whatever editor | |
| 264 | + is specified by your VISUAL or EDITOR environment variable. If none is | |
| 265 | + specified Fossil uses line-editing in the terminal.</p> | |
| 266 | + | |
| 267 | + <p>To commit your changes to a repository that was cloned from remote you | |
| 268 | + perform the same actions but the results are different. Fossil | |
| 269 | + defaults to 'autosync' mode, a single-stage commit that sends all changes | |
| 270 | + committed to the local repository immediately on to the remote parent repository. This | |
| 271 | + only works if you have write permission to the remote respository.</p> | |
| 272 | + | |
| 145 | 273 | <h2 id="config">Configuring Your Local Repository</h2> |
| 146 | 274 | |
| 147 | 275 | <p>When you create a new repository, either by cloning an existing |
| 148 | 276 | project or create a new project of your own, you usually want to do some |
| 149 | 277 | local configuration. This is easily accomplished using the web-server |
| 150 | 278 |
| --- www/quickstart.wiki | |
| +++ www/quickstart.wiki | |
| @@ -1,26 +1,34 @@ | |
| 1 | <title>Fossil Quick Start Guide</title> |
| 2 | <h1 align="center">Fossil Quick Start</h1> |
| 3 | |
| 4 | <p>This is a guide to help you get started using Fossil quickly |
| 5 | and painlessly.</p> |
| 6 | |
| 7 | <h2 id="install">Installing</h2> |
| 8 | |
| 9 | <p>Fossil is a single self-contained C program. You need to |
| 10 | either download a |
| 11 | <a href="https://www.fossil-scm.org/fossil/uv/download.html">precompiled |
| 12 | binary</a> |
| 13 | or <a href="build.wiki">compile it yourself</a> from sources. |
| 14 | Install Fossil by putting the fossil binary |
| 15 | someplace on your $PATH.</p> |
| 16 | |
| 17 | <h2 id="workflow" name="fslclone">General Work Flow</h2> |
| 18 | |
| 19 | <p>Fossil works with repository files (a database with the project's |
| 20 | complete history) and with checked-out local trees (the working directory |
| 21 | you use to do your work). |
| 22 | (See [./whyusefossil.wiki#definitions | definitions] for more background.) |
| 23 | The workflow looks like this:</p> |
| 24 | |
| 25 | <ul> |
| 26 | <li>Create or clone a repository file. ([/help/init|fossil init] or |
| @@ -27,10 +35,13 @@ | |
| 27 | [/help/clone | fossil clone]) |
| 28 | <li>Check out a local tree. ([/help/open | fossil open]) |
| 29 | <li>Perform operations on the repository (including repository |
| 30 | configuration). |
| 31 | </ul> |
| 32 | |
| 33 | <p>The following sections will give you a brief overview of these |
| 34 | operations.</p> |
| 35 | |
| 36 | <h2 id="new">Starting A New Project</h2> |
| @@ -39,10 +50,14 @@ | |
| 39 | this way: ([/help/init | more info]) </p> |
| 40 | |
| 41 | <blockquote> |
| 42 | <b>fossil init </b><i> repository-filename</i> |
| 43 | </blockquote> |
| 44 | |
| 45 | <h2 id="clone">Cloning An Existing Repository</h2> |
| 46 | |
| 47 | <p>Most fossil operations interact with a repository that is on the |
| 48 | local disk drive, not on a remote system. Hence, before accessing |
| @@ -57,46 +72,72 @@ | |
| 57 | </blockquote> |
| 58 | |
| 59 | <p>The <i>URL</i> specifies the fossil repository |
| 60 | you want to clone. The <i>repository-filename</i> is the new local |
| 61 | filename into which the cloned repository will be written. For |
| 62 | example: |
| 63 | |
| 64 | <blockquote> |
| 65 | <b>fossil clone http://www.fossil-scm.org/ myclone.fossil</b> |
| 66 | </blockquote> |
| 67 | |
| 68 | <p>If the remote repository requires a login, include a |
| 69 | userid in the URL like this: |
| 70 | |
| 71 | <blockquote> |
| 72 | <b>fossil clone http://</b><i>userid</i><b>@www.fossil-scm.org/ myclone.fossil</b> |
| 73 | </blockquote> |
| 74 | |
| 75 | |
| 76 | <p>You will be prompted separately for the password. |
| 77 | Use "%HH" escapes for special characters in the userid. |
| 78 | Examples: "%40" in place of "@" and "%2F" in place of "/". |
| 79 | |
| 80 | <p>If you are behind a restrictive firewall, you might need |
| 81 | to <a href="#proxy">specify an HTTP proxy</a>.</p> |
| 82 | |
| 83 | <p>A Fossil repository is a single disk file. Instead of cloning, |
| 84 | you can just make a copy of the repository file (for example, using |
| 85 | "scp"). Note, however, that the repository file contains auxiliary |
| 86 | information above and beyond the versioned files, including some |
| 87 | sensitive information such as password hashes and email addresses. If you |
| 88 | want to share Fossil repositories directly, consider running the |
| 89 | [/help/scrub|fossil scrub] command to remove sensitive information |
| 90 | before transmitting the file. |
| 91 | |
| 92 | <h2 id="import">Importing From Another Version Control System</h2> |
| 93 | |
| 94 | <p>Rather than start a new project, or clone an existing Fossil project, |
| 95 | you might prefer to |
| 96 | <a href="./inout.wiki">import an existing Git project</a> |
| 97 | into Fossil using the [/help/import | fossil import] command. |
| 98 | |
| 99 | <h2 id="checkout">Checking Out A Local Tree</h2> |
| 100 | |
| 101 | <p>To work on a project in fossil, you need to check out a local |
| 102 | copy of the source tree. Create the directory you want to be |
| @@ -105,10 +146,24 @@ | |
| 105 | |
| 106 | <blockquote> |
| 107 | <b>fossil open </b><i> repository-filename</i> |
| 108 | </blockquote> |
| 109 | |
| 110 | <p>This leaves you with the newest version of the tree |
| 111 | checked out. |
| 112 | From anywhere underneath the root of your local tree, you |
| 113 | can type commands like the following to find out the status of |
| 114 | your local tree:</p> |
| @@ -120,10 +175,13 @@ | |
| 120 | <b>[/help/diff | fossil diff]</b><br> |
| 121 | <b>[/help/timeline | fossil timeline]</b><br> |
| 122 | <b>[/help/ls | fossil ls]</b><br> |
| 123 | <b>[/help/branch | fossil branch]</b><br> |
| 124 | </blockquote> |
| 125 | |
| 126 | <p>Note that Fossil allows you to make multiple check-outs in |
| 127 | separate directories from the same repository. This enables you, |
| 128 | for example, to do builds from multiple branches or versions at |
| 129 | the same time without having to generate extra clones.</p> |
| @@ -140,10 +198,80 @@ | |
| 140 | does a "soft" switch, merging any local changes into the target |
| 141 | version, whereas [/help/checkout | checkout] does not |
| 142 | automatically sync and does a "hard" switch, overwriting local |
| 143 | changes if told to do so.</p> |
| 144 | |
| 145 | <h2 id="config">Configuring Your Local Repository</h2> |
| 146 | |
| 147 | <p>When you create a new repository, either by cloning an existing |
| 148 | project or create a new project of your own, you usually want to do some |
| 149 | local configuration. This is easily accomplished using the web-server |
| 150 |
| --- www/quickstart.wiki | |
| +++ www/quickstart.wiki | |
| @@ -1,26 +1,34 @@ | |
| 1 | <title>Fossil Quick Start Guide</title> |
| 2 | <h1 align="center">Fossil Quick Start</h1> |
| 3 | |
| 4 | <p>This is a guide to help you get started using the Fossil [https://en.wikipedia.org/wiki/Distributed_version_control|Distributed Version Control System] quickly |
| 5 | and painlessly.</p> |
| 6 | |
| 7 | <h2 id="install">Installing</h2> |
| 8 | |
| 9 | <p>Fossil is a single self-contained C program. You need to |
| 10 | either download a |
| 11 | [https://www.fossil-scm.org/fossil/uv/download.html|precompiled |
| 12 | binary] |
| 13 | or <a href="build.wiki">compile it yourself</a> from sources. |
| 14 | Install Fossil by putting the fossil binary |
| 15 | someplace on your $PATH.</p> |
| 16 | You can test that Fossil is present and working like this: |
| 17 | |
| 18 | <blockquote> |
| 19 | <b> |
| 20 | fossil version<br> |
| 21 | This is fossil version 2.13 [309af345ab] 2020-09-28 04:02:55 UTC<br> |
| 22 | </b> |
| 23 | </blockquote> |
| 24 | |
| 25 | <h2 id="workflow" name="fslclone">General Work Flow</h2> |
| 26 | |
| 27 | <p>Fossil works with repository files (a database in a single file with the project's |
| 28 | complete history) and with checked-out local trees (the working directory |
| 29 | you use to do your work). |
| 30 | (See [./whyusefossil.wiki#definitions | definitions] for more background.) |
| 31 | The workflow looks like this:</p> |
| 32 | |
| 33 | <ul> |
| 34 | <li>Create or clone a repository file. ([/help/init|fossil init] or |
| @@ -27,10 +35,13 @@ | |
| 35 | [/help/clone | fossil clone]) |
| 36 | <li>Check out a local tree. ([/help/open | fossil open]) |
| 37 | <li>Perform operations on the repository (including repository |
| 38 | configuration). |
| 39 | </ul> |
| 40 | |
| 41 | Fossil can be entirely driven from the command line, while many features |
| 42 | can also be conveniently accessed from the build-in web interface. |
| 43 | |
| 44 | <p>The following sections will give you a brief overview of these |
| 45 | operations.</p> |
| 46 | |
| 47 | <h2 id="new">Starting A New Project</h2> |
| @@ -39,10 +50,14 @@ | |
| 50 | this way: ([/help/init | more info]) </p> |
| 51 | |
| 52 | <blockquote> |
| 53 | <b>fossil init </b><i> repository-filename</i> |
| 54 | </blockquote> |
| 55 | |
| 56 | You can name the database anything you like, and you can place it anywhere in the filesystem. |
| 57 | The <tt>.fossil</tt> extension is traditional but only required if you are going to use the |
| 58 | <tt>[./help?cmd=/server | fossil server DIRECTORY]</tt> feature.” |
| 59 | |
| 60 | <h2 id="clone">Cloning An Existing Repository</h2> |
| 61 | |
| 62 | <p>Most fossil operations interact with a repository that is on the |
| 63 | local disk drive, not on a remote system. Hence, before accessing |
| @@ -57,46 +72,72 @@ | |
| 72 | </blockquote> |
| 73 | |
| 74 | <p>The <i>URL</i> specifies the fossil repository |
| 75 | you want to clone. The <i>repository-filename</i> is the new local |
| 76 | filename into which the cloned repository will be written. For |
| 77 | example, to clone the source code of Fossil itself: |
| 78 | |
| 79 | <blockquote> |
| 80 | <b>fossil clone https://www.fossil-scm.org/ myclone.fossil</b> |
| 81 | </blockquote> |
| 82 | |
| 83 | If your logged-in username is 'exampleuser', you should see output something like this: |
| 84 | |
| 85 | <blockquote> |
| 86 | <b> |
| 87 | Round-trips: 8 Artifacts sent: 0 received: 39421<br> |
| 88 | Clone done, sent: 2424 received: 42965725 ip: 10.10.10.0<br> |
| 89 | Rebuilding repository meta-data...<br> |
| 90 | 100% complete...<br> |
| 91 | Extra delta compression... <br> |
| 92 | Vacuuming the database... <br> |
| 93 | project-id: 94259BB9F186226D80E49D1FA2DB29F935CCA0333<br> |
| 94 | server-id: 016595e9043054038a9ea9bc526d7f33f7ac0e42<br> |
| 95 | admin-user: exampleuser (password is "yoWgDR42iv")><br> |
| 96 | </b> |
| 97 | </blockquote> |
| 98 | |
| 99 | <p>If the remote repository requires a login, include a |
| 100 | userid in the URL like this: |
| 101 | |
| 102 | <blockquote> |
| 103 | <b>fossil clone https://</b><i>remoteuserid</i><b>@www.example.org/ myclone.fossil</b> |
| 104 | </blockquote> |
| 105 | |
| 106 | <p>You will be prompted separately for the password. |
| 107 | Use [https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters|"%HH"] escapes for special characters in the userid. |
| 108 | For example "/" would be replaced by "%2F" meaning that a userid of "Projects/Budget" would become "Projects%2FBudget") </p> |
| 109 | |
| 110 | <p>If you are behind a restrictive firewall, you might need |
| 111 | to <a href="#proxy">specify an HTTP proxy</a>.</p> |
| 112 | |
| 113 | <p>A Fossil repository is a single disk file. Instead of cloning, |
| 114 | you can just make a copy of the repository file (for example, using |
| 115 | "scp"). Note, however, that the repository file contains auxiliary |
| 116 | information above and beyond the versioned files, including some |
| 117 | sensitive information such as password hashes and email addresses. If you |
| 118 | want to share Fossil repositories directly by copying, consider running the |
| 119 | [/help/scrub|fossil scrub] command to remove sensitive information |
| 120 | before transmitting the file. |
| 121 | |
| 122 | <h2 id="import">Importing From Another Version Control System</h2> |
| 123 | |
| 124 | <p>Rather than start a new project, or clone an existing Fossil project, |
| 125 | you might prefer to |
| 126 | <a href="./inout.wiki">import an existing Git project</a> |
| 127 | into Fossil using the [/help/import | fossil import] command. |
| 128 | |
| 129 | You can even decide to export your project back into git using the |
| 130 | [/help/git | fossil git] command, which is how the Fossil project maintains |
| 131 | [https://github.com/drhsqlite/fossil-mirror | its public GitHub mirror]. There |
| 132 | is no limit to the number of times a tree can be imported and exported between |
| 133 | Fossil and git. |
| 134 | |
| 135 | The [https://git-scm.com/docs/git-fast-export|Git fast-export format] has become |
| 136 | a popular way to move files between version management systems, including from |
| 137 | [https://www.mercurial-scm.org/|Mercurial]. |
| 138 | Fossil can also import [https://subversion.apache.org/|Subversion projects] directly. |
| 139 | |
| 140 | <h2 id="checkout">Checking Out A Local Tree</h2> |
| 141 | |
| 142 | <p>To work on a project in fossil, you need to check out a local |
| 143 | copy of the source tree. Create the directory you want to be |
| @@ -105,10 +146,24 @@ | |
| 146 | |
| 147 | <blockquote> |
| 148 | <b>fossil open </b><i> repository-filename</i> |
| 149 | </blockquote> |
| 150 | |
| 151 | for example: |
| 152 | |
| 153 | <blockquote> |
| 154 | <b> |
| 155 | fossil open ../myclone.fossil<br> |
| 156 | BUILD.txt<br> |
| 157 | COPYRIGHT-BSD2.txt<br> |
| 158 | README.md<br> |
| 159 | ︙<br> |
| 160 | </b> |
| 161 | </blockquote> |
| 162 | |
| 163 | (or "fossil open ..\myclone.fossil" on Windows). |
| 164 | |
| 165 | <p>This leaves you with the newest version of the tree |
| 166 | checked out. |
| 167 | From anywhere underneath the root of your local tree, you |
| 168 | can type commands like the following to find out the status of |
| 169 | your local tree:</p> |
| @@ -120,10 +175,13 @@ | |
| 175 | <b>[/help/diff | fossil diff]</b><br> |
| 176 | <b>[/help/timeline | fossil timeline]</b><br> |
| 177 | <b>[/help/ls | fossil ls]</b><br> |
| 178 | <b>[/help/branch | fossil branch]</b><br> |
| 179 | </blockquote> |
| 180 | |
| 181 | <p>If you created a new respository using "fossil init" then some commands will not |
| 182 | produce much output.</p> |
| 183 | |
| 184 | <p>Note that Fossil allows you to make multiple check-outs in |
| 185 | separate directories from the same repository. This enables you, |
| 186 | for example, to do builds from multiple branches or versions at |
| 187 | the same time without having to generate extra clones.</p> |
| @@ -140,10 +198,80 @@ | |
| 198 | does a "soft" switch, merging any local changes into the target |
| 199 | version, whereas [/help/checkout | checkout] does not |
| 200 | automatically sync and does a "hard" switch, overwriting local |
| 201 | changes if told to do so.</p> |
| 202 | |
| 203 | <h2 id="changes">Making and Commiting Changes</h2> |
| 204 | |
| 205 | <p>To add new files to your project or remove existing ones, use these |
| 206 | commands:</p> |
| 207 | |
| 208 | <blockquote> |
| 209 | <b>[/help/add | fossil add]</b> <i>file...</i><br> |
| 210 | <b>[/help/rm | fossil rm]</b> <i>file...</i><br> |
| 211 | <b>[/help/addremove | fossil addremove]</b> <i>file...</i><br> |
| 212 | </blockquote> |
| 213 | |
| 214 | <p>The command:</p> |
| 215 | <blockquote> |
| 216 | <b> |
| 217 | [/help/changes | fossil changes]</b> |
| 218 | </blockquote> |
| 219 | <p>lists files that have changed since the last commit to the repository. For |
| 220 | example, if you edit the file "README.md":</p> |
| 221 | |
| 222 | <blockquote> |
| 223 | <b> |
| 224 | fossil changes<br> |
| 225 | EDITED README.md |
| 226 | </b> |
| 227 | </blockquote> |
| 228 | |
| 229 | <p>To see exactly what change was made you can use the command</p> |
| 230 | [/help/diff | fossil diff]: |
| 231 | <blockquote> |
| 232 | <b> |
| 233 | fossil diff <br> |
| 234 | Index: README.md<br> |
| 235 | ============================================================<br> |
| 236 | --- README.md<br> |
| 237 | +++ README.md<br> |
| 238 | @@ -1,5 +1,6 @@<br> |
| 239 | +I made a change<br> |
| 240 | # Original text<br> |
| 241 | </b> |
| 242 | </blockquote> |
| 243 | |
| 244 | <p>"fossil diff" is the difference between your tree on disk now and as it was |
| 245 | when you did "fossil open". An open is the first checkout from a repository |
| 246 | into a new directory. </p> |
| 247 | |
| 248 | <p>To commit your changes to a local-only repository:</p> |
| 249 | <blockquote> |
| 250 | <b> |
| 251 | fossil commit (... Fossil will start your editor, if defined)<br> |
| 252 | # Enter a commit message for this check-in. Lines beginning with # are ignored.<br> |
| 253 | #<br> |
| 254 | # user: exampleuser<br> |
| 255 | # tags: trunk<br> |
| 256 | #<br> |
| 257 | # EDITED README.md<br> |
| 258 | Edited file to add description of code changes<br> |
| 259 | New_Version: 7b9a416ced4a69a60589dde1aedd1a30fde8eec3528d265dbeed5135530440ab<br> |
| 260 | </b> |
| 261 | </blockquote> |
| 262 | |
| 263 | <p>You will be prompted for check-in comments using whatever editor |
| 264 | is specified by your VISUAL or EDITOR environment variable. If none is |
| 265 | specified Fossil uses line-editing in the terminal.</p> |
| 266 | |
| 267 | <p>To commit your changes to a repository that was cloned from remote you |
| 268 | perform the same actions but the results are different. Fossil |
| 269 | defaults to 'autosync' mode, a single-stage commit that sends all changes |
| 270 | committed to the local repository immediately on to the remote parent repository. This |
| 271 | only works if you have write permission to the remote respository.</p> |
| 272 | |
| 273 | <h2 id="config">Configuring Your Local Repository</h2> |
| 274 | |
| 275 | <p>When you create a new repository, either by cloning an existing |
| 276 | project or create a new project of your own, you usually want to do some |
| 277 | local configuration. This is easily accomplished using the web-server |
| 278 |