Diff
Not logged in

Differences From Artifact [74b85495fa]:

To Artifact [e2130117b1]:


11
12
13
14
15
16
17
18
19
20
21
22



23
24
25
26
27
28
29
30
11
12
13
14
15
16
17





18
19
20

21
22
23
24
25
26
27







-
-
-
-
-
+
+
+
-







binary]
or <a href="build.wiki">compile it yourself</a> from sources.
Install Fossil by putting the fossil binary
someplace on your $PATH.

You can test that Fossil is present and working like this:

<blockquote>
<b>
fossil version<br>
<tt>This is fossil version 2.13 [309af345ab] 2020-09-28 04:02:55 UTC</tt><br>
</b>
<pre><b>fossil version
This is fossil version 2.13 [309af345ab] 2020-09-28 04:02:55 UTC
</b></pre>
</blockquote>

<h2 id="workflow" name="fslclone">General Work Flow</h2>

Fossil works with repository files (a database in a single file with the project's
complete history) and with checked-out local trees (the working directory
you use to do your work). 
(See [./glossary.md | the glossary] for more background.)
45
46
47
48
49
50
51
52
53
54


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72


73
74
75
76
77
78
79
80

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96










97
98
99
100
101
102
103

104
105
106
107
108
109
110
111
42
43
44
45
46
47
48



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65



66
67
68
69
70
71
72
73


74

75
76
77












78
79
80
81
82
83
84
85
86
87

88
89
90
91


92

93
94
95
96
97
98
99







-
-
-
+
+















-
-
-
+
+






-
-
+
-



-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-




-
-
+
-







operations.

<h2 id="new">Starting A New Project</h2>

To start a new project with fossil create a new empty repository
this way: ([/help/init | more info])

<blockquote>
<b>fossil init </b><i> repository-filename</i>
</blockquote>
<pre><b>fossil init</b> <i>repository-filename</i>
</pre>

You can name the database anything you like, and you can place it anywhere in the filesystem.
The <tt>.fossil</tt> extension is traditional but only required if you are going to use the 
<tt>[/help/server | fossil server DIRECTORY]</tt> feature.”

<h2 id="clone">Cloning An Existing Repository</h2>

Most fossil operations interact with a repository that is on the
local disk drive, not on a remote system.  Hence, before accessing
a remote repository it is necessary to make a local copy of that
repository.  Making a local copy of a remote repository is called
"cloning".

Clone a remote repository as follows: ([/help/clone | more info])

<blockquote>
<b>fossil clone</b> <i>URL  repository-filename</i>
</blockquote>
<pre><b>fossil clone</b> <i>URL repository-filename</i>
</pre>

The <i>URL</i> specifies the fossil repository
you want to clone.  The <i>repository-filename</i> is the new local
filename into which the cloned repository will be written.  For
example, to clone the source code of Fossil itself:

<blockquote>
<b>fossil clone https://fossil-scm.org/ myclone.fossil</b>
<pre><b>fossil clone https://fossil-scm.org/ myclone.fossil</b></pre>
</blockquote>

If your logged-in username is 'exampleuser', you should see output something like this:

<blockquote>
<b><tt>
        Round-trips: 8   Artifacts sent: 0  received: 39421<br>
        Clone done, sent: 2424  received: 42965725  ip: 10.10.10.0<br>
        Rebuilding repository meta-data...<br>
        100% complete...<br>
        Extra delta compression... <br>
        Vacuuming the database... <br>
        project-id: 94259BB9F186226D80E49D1FA2DB29F935CCA0333<br>
        server-id:  016595e9043054038a9ea9bc526d7f33f7ac0e42<br>
        admin-user: exampleuser (password is "yoWgDR42iv")><br>
</tt></b>
<pre><b>Round-trips: 8   Artifacts sent: 0  received: 39421
Clone done, sent: 2424  received: 42965725  ip: 10.10.10.0
Rebuilding repository meta-data...
100% complete...
Extra delta compression... 
Vacuuming the database... 
project-id: 94259BB9F186226D80E49D1FA2DB29F935CCA0333
server-id:  016595e9043054038a9ea9bc526d7f33f7ac0e42
admin-user: exampleuser (password is "yoWgDR42iv")>
</b></pre>
</blockquote>

If the remote repository requires a login, include a
userid in the URL like this:

<blockquote>
<b>fossil clone https://</b><i>remoteuserid</i><b>@www.example.org/ myclone.fossil</b>
<pre><b>fossil clone https://</b><i>remoteuserid</i><b>@www.example.org/ myclone.fossil</b></pre>
</blockquote>

You will be prompted separately for the password.
Use [https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters|"%HH"] escapes for special characters in the userid.
For example "/" would be replaced by "%2F" meaning that a userid of "Projects/Budget" would become "Projects%2FBudget")

If you are behind a restrictive firewall, you might need
to <a href="#proxy">specify an HTTP proxy</a>.
140
141
142
143
144
145
146
147
148

149
150
151
152
153
154
155
156
157
158
159
160






161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179









180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195




196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212





213
214
215
216
217
218

219
220
221
222
223
224
225
226
227
228



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244









245
246
247
248
249
250
251
252
253
254
255
256

257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
















274
275
276
277
278
279
280

281
282
283


284
285
286



287
288
289
290
291





292
293
294
295
296
297
298
299
128
129
130
131
132
133
134


135

136
137
138








139
140
141
142
143
144

145
146
147
148
149
150
151
152
153









154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174




175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190





191
192
193
194
195
196
197
198



199

200
201
202
203





204
205
206

207
208
209
210











211
212
213
214
215
216
217
218
219

220
221
222
223
224
225
226
227
228
229

230

















231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246

247
248
249
250
251

252



253
254



255
256
257





258
259
260
261
262

263
264
265
266
267
268
269







-
-
+
-



-
-
-
-
-
-
-
-
+
+
+
+
+
+
-









-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+












-
-
-
-
+
+
+
+












-
-
-
-
-
+
+
+
+
+



-
-
-
+
-




-
-
-
-
-
+
+
+
-




-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-










-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-





-
+
-
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-







<h2 id="checkout">Checking Out A Local Tree</h2>

To work on a project in fossil, you need to check out a local
copy of the source tree.  Create the directory you want to be
the root of your tree and cd into that directory.  Then
do this: ([/help/open | more info])

<blockquote>
<b>fossil open </b><i> repository-filename</i>
<pre><b>fossil open</b> <i>repository-filename</i></pre>
</blockquote>

for example:

<blockquote>
<b><tt>
    fossil open ../myclone.fossil<br>
    BUILD.txt<br>
    COPYRIGHT-BSD2.txt<br>
    README.md<br><br>
</tt></b>
<pre><b>fossil open ../myclone.fossil
    BUILD.txt
    COPYRIGHT-BSD2.txt
    README.md
      ︙
</tt></b></pre>
</blockquote>

(or "fossil open ..\myclone.fossil" on Windows).

This leaves you with the newest version of the tree
checked out.
From anywhere underneath the root of your local tree, you
can type commands like the following to find out the status of
your local tree:

<blockquote>
<b>[/help/info | fossil info]</b><br>
<b>[/help/status | fossil status]</b><br>
<b>[/help/changes | fossil changes]</b><br>
<b>[/help/diff | fossil diff]</b><br>
<b>[/help/timeline | fossil timeline]</b><br>
<b>[/help/ls | fossil ls]</b><br>
<b>[/help/branch | fossil branch]</b><br>
</blockquote>
<pre>
<b>[/help/info | fossil info]</b>
<b>[/help/status | fossil status]</b>
<b>[/help/changes | fossil changes]</b>
<b>[/help/diff | fossil diff]</b>
<b>[/help/timeline | fossil timeline]</b>
<b>[/help/ls | fossil ls]</b>
<b>[/help/branch | fossil branch]</b>
</pre>

If you created a new repository using "fossil init" some commands will not
produce much output.

Note that Fossil allows you to make multiple check-outs in
separate directories from the same repository.  This enables you,
for example, to do builds from multiple branches or versions at
the same time without having to generate extra clones.

To switch a checkout between different versions and branches,
use:<

<blockquote>
<b>[/help/update | fossil update]</b><br>
<b>[/help/checkout | fossil checkout]</b><br>
</blockquote>
<pre>
<b>[/help/update | fossil update]</b>
<b>[/help/checkout | fossil checkout]</b>
</pre>

[/help/update | update] honors the "autosync" option and
does a "soft" switch, merging any local changes into the target
version, whereas [/help/checkout | checkout] does not
automatically sync and does a "hard" switch, overwriting local
changes if told to do so.

<h2 id="changes">Making and Committing Changes</h2>

To add new files to your project or remove existing ones, use these
commands:

<blockquote>
<b>[/help/add | fossil add]</b> <i>file...</i><br>
<b>[/help/rm | fossil rm]</b> <i>file...</i><br>
<b>[/help/addremove | fossil addremove]</b> <i>file...</i><br>
</blockquote>
<pre>
<b>[/help/add | fossil add]</b> <i>file...</i>
<b>[/help/rm | fossil rm]</b> <i>file...</i>
<b>[/help/addremove | fossil addremove]</b> <i>file...</i>
</pre>

The command:

<blockquote>
<b>
        [/help/changes | fossil changes]</b>
<pre><b>[/help/changes | fossil changes]</b></pre>
</blockquote>

lists files that have changed since the last commit to the repository. For
example, if you edit the file "README.md":

<blockquote>
<b>
        fossil changes<br>
        EDITED     README.md
</b>
<pre><b>fossil changes
EDITED     README.md
</b></pre>
</blockquote>

To see exactly what change was made you can use the command
<b>[/help/diff | fossil diff]</b>:

<blockquote>
<b>
        fossil diff <br><tt>
        Index: README.md<br>
        ============================================================<br>
        --- README.md<br>
        +++ README.md<br>
        @@ -1,5 +1,6 @@<br>
        +Made some changes to the project<br>
        # Original text<br>
 </tt></b>
<pre><b>fossil diff
Index: README.md
============================================================
--- README.md
+++ README.md
@@ -1,5 +1,6 @@
+Made some changes to the project
# Original text
</b></pre>
</blockquote>

"fossil diff" shows the difference between your tree on disk now and as
the tree was when you last committed changes. If you haven't committed
yet, then it shows the difference relative to the tip-of-trunk commit in
the repository, being what you get when you "fossil open" a repository
without specifying a version, populating the working directory.

To see the most recent changes made to the repository by other users, use "fossil timeline" to
find out the most recent commit, and then "fossil diff" between that commit and the
current tree:
<blockquote>

<b>
        fossil timeline <br><tt>
        === 2021-03-28 === <br>
        03:18:54 [ad75dfa4a0] *CURRENT* Added details to frobnicate command (user: user-one tags: trunk) <br>
        === 2021-03-27 === <br>
        23:58:05 [ab975c6632] Update README.md. (user: user-two tags: trunk) <br>
             ⋮ <br>
        </tt><br>
        fossil diff --from current --to ab975c6632 <br><tt>
        Index: frobnicate.c<br>
        ============================================================<br>
        --- frobnicate.c<br>
        +++ frobnicate.c<br>
        @@ -1,10 +1,11 @@<br>
        +/* made a change to the source file */<br>
        # Original text<br>
</tt></b>
<pre><b>fossil timeline
=== 2021-03-28 === 
03:18:54 [ad75dfa4a0] *CURRENT* Added details to frobnicate command (user: user-one tags: trunk) 
=== 2021-03-27 === 
23:58:05 [ab975c6632] Update README.md. (user: user-two tags: trunk) 
     

fossil diff --from current --to ab975c6632
Index: frobnicate.c
============================================================
--- frobnicate.c
+++ frobnicate.c
@@ -1,10 +1,11 @@
+/* made a change to the source file */
# Original text
</b></pre>
</blockquote>

"current" is an alias for the checkout version, so the command
"fossil diff --from ad75dfa4a0 --to ab975c6632" gives identical results.

To commit your changes to a local-only repository:
<blockquote>

<b>
fossil commit     </b><i>(... Fossil will start your editor, if defined)</i><b><br><tt>
# Enter a commit message for this check-in. Lines beginning with # are ignored.<br>
<pre><b>fossil commit</b>     <i>(... Fossil will start your editor, if defined)</i><b>
# Enter a commit message for this check-in. Lines beginning with # are ignored.
#<br>
# user: exampleuser<br>
# tags: trunk<br>
#
# user: exampleuser
# tags: trunk
#<br>
# EDITED     README.md<br>
Edited file to add description of code changes<br>
New_Version: 7b9a416ced4a69a60589dde1aedd1a30fde8eec3528d265dbeed5135530440ab<br>
</tt></b>
#
# EDITED     README.md
Edited file to add description of code changes
New_Version: 7b9a416ced4a69a60589dde1aedd1a30fde8eec3528d265dbeed5135530440ab
</b></pre>
</blockquote>

You will be prompted for check-in comments using whatever editor
is specified by your VISUAL or EDITOR environment variable. If none is
specified Fossil uses line-editing in the terminal.

To commit your changes to a repository that was cloned from a remote
repository, you give the same command, but the results are different.
330
331
332
333
334
335
336
337
338
339



340
341
342
343
344
345
346
347
348
349
350
351
352



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368

369
370

371
372
373
374
375
376
377
378
379
380
381


382
383

384
385
386
387
388
389

390
391

392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408

409
410

411
412
413
414
415
416
417
300
301
302
303
304
305
306



307
308
309
310
311
312
313
314
315
316
317
318
319



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337

338
339

340
341
342
343
344
345
346
347
348
349


350
351
352

353
354
355
356
357
358

359
360

361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377

378
379

380
381
382
383
384
385
386
387







-
-
-
+
+
+










-
-
-
+
+
+















-
+

-
+









-
-
+
+

-
+





-
+

-
+
















-
+

-
+








When you create a new repository, either by cloning an existing
project or create a new project of your own, you usually want to do some
local configuration.  This is easily accomplished using the web-server
that is built into fossil.  Start the fossil web server like this:
([/help/ui | more info])

<blockquote>
<b>fossil ui </b><i> repository-filename</i>
</blockquote>
<pre>
<b>fossil ui</b> <i>repository-filename</i>
</pre>

You can omit the <i>repository-filename</i> from the command above
if you are inside a checked-out local tree.

This starts a web server then automatically launches your
web browser and makes it point to this web server.  If your system
has an unusual configuration, fossil might not be able to figure out
how to start your web browser.  In that case, first tell fossil
where to find your web browser using a command like this:

<blockquote>
<b>fossil setting web-browser </b><i>  path-to-web-browser</i>
</blockquote>
<pre>
<b>fossil setting web-browser</b> <i>path-to-web-browser</i>
</pre>

By default, fossil does not require a login for HTTP connections
coming in from the IP loopback address 127.0.0.1.  You can, and perhaps
should, change this after you create a few users.

When you are finished configuring, just press Control-C or use
the <b>kill</b> command to shut down the mini-server.

<h2 id="sharing">Sharing Changes</h2>

When [./concepts.wiki#workflow|autosync] is turned off,
the changes you [/help/commit | commit] are only
on your local repository.
To share those changes with other repositories, do:

<blockquote>
<pre>
<b>[/help/push | fossil push]</b> <i>URL</i>
</blockquote>
</pre>

Where <i>URL</i> is the http: URL of the server repository you
want to share your changes with.  If you omit the <i>URL</i> argument,
fossil will use whatever server you most recently synced with.

The [/help/push | push] command only sends your changes to others.  To
Receive changes from others, use [/help/pull | pull].  Or go both ways at
once using [/help/sync | sync]:

<blockquote>
<b>[/help/pull | fossil pull]</b> <i>URL</i><br>
<pre>
<b>[/help/pull | fossil pull]</b> <i>URL</i>
<b>[/help/sync | fossil sync]</b> <i>URL</i>
</blockquote>
</pre>

When you pull in changes from others, they go into your repository,
not into your checked-out local tree.  To get the changes into your
local tree, use [/help/update | update]:

<blockquote>
<pre>
<b>[/help/update | fossil update]</b> <i>VERSION</i>
</blockquote>
</pre>

The <i>VERSION</i> can be the name of a branch or tag or any
abbreviation to the 40-character
artifact identifier for a particular check-in, or it can be a
date/time stamp.  ([./checkin_names.wiki | more info])
If you omit
the <i>VERSION</i>, then fossil moves you to the
latest version of the branch your are currently on.

The default behavior is for [./concepts.wiki#workflow|autosync] to
be turned on.  That means that a [/help/pull|pull] automatically occurs
when you run [/help/update|update] and a [/help/push|push] happens
automatically after you [/help/commit|commit].  So in normal practice,
the push, pull, and sync commands are rarely used.  But it is important
to know about them, all the same.

<blockquote>
<pre>
<b>[/help/checkout | fossil checkout]</b> <i>VERSION</i>
</blockquote>
</pre>

Is similar to update except that it does not honor the autosync
setting, nor does it merge in local changes - it prefers to overwrite
them and fails if local changes exist unless the <tt>--force</tt>
flag is used.

<h2 id="branch" name="merge">Branching And Merging</h2>
425
426
427
428
429
430
431
432
433
434
435




436
437

438
439
440
441
442
443
444
395
396
397
398
399
400
401




402
403
404
405
406

407
408
409
410
411
412
413
414







-
-
-
-
+
+
+
+

-
+








To merge two branches back together, first
[/help/update | update] to the branch you want to merge into.
Then do a [/help/merge|merge] of the other branch that you want to incorporate
the changes from.  For example, to merge "featureX" changes into "trunk"
do this:

<blockquote>
<b>fossil [/help/update|update] trunk</b><br>
<b>fossil [/help/merge|merge] featureX</b><br>
<i># make sure the merge didn't break anything...</i><br>
<pre>
<b>fossil [/help/update|update] trunk</b>
<b>fossil [/help/merge|merge] featureX</b>
<i># make sure the merge didn't break anything...</i>
<b>fossil [/help/commit|commit]
</blockquote>
</pre>

The argument to the [/help/merge|merge] command can be any of the
version identifier forms that work for [/help/update|update].
([./checkin_names.wiki|more info].)
The merge command has options to cherry-pick individual
changes, or to back out individual changes, if you don't want to
do a full merge.
457
458
459
460
461
462
463
464

465
466

467
468
469
470
471
472
473
474
475
476
477
478
479
480
481


482
483

484
485
486
487
488
489
490
427
428
429
430
431
432
433

434
435

436
437
438
439
440
441
442
443
444
445
446
447
448
449


450
451
452

453
454
455
456
457
458
459
460







-
+

-
+













-
-
+
+

-
+







into trunk previously, you can do so again and Fossil will automatically
know to pull in only those changes that have occurred since the previous
merge.

If a merge or update doesn't work out (perhaps something breaks or
there are many merge conflicts) then you back up using:

<blockquote>
<pre>
<b>[/help/undo | fossil undo]</b>
</blockquote>
</pre>

This will back out the changes that the merge or update made to the
working checkout.  There is also a [/help/redo|redo] command if you undo by
mistake.  Undo and redo only work for changes that have
not yet been checked in using commit and there is only a single
level of undo/redo.


<h2 id="server">Setting Up A Server</h2>

Fossil can act as a stand-alone web server using one of these
commands:

<blockquote>
<b>[/help/server | fossil server]</b> <i>repository-filename</i><br>
<pre>
<b>[/help/server | fossil server]</b> <i>repository-filename</i>
<b>[/help/ui | fossil ui]</b> <i>repository-filename</i>
</blockquote>
</pre>

The <i>repository-filename</i> can be omitted when these commands
are run from within an open check-out, which is a particularly useful
shortcut with the <b>fossil ui</b> command.

The <b>ui</b> command is intended for accessing the web user interface
from a local desktop. (We sometimes call this mode "Fossil UI.")
524
525
526
527
528
529
530
531
532
533



534
535
536
537
538
539

540
541

542
543
544
545

546
547

548
549
550
551

552
553

554
555
556
557
558
559
560
561
562

563
564

565
566
567
568
569
570
571
572
573
574
575
494
495
496
497
498
499
500



501
502
503
504
505
506
507
508

509
510

511
512
513
514

515
516

517
518
519
520

521
522

523
524
525
526
527
528
529
530
531

532
533

534
535
536
537
538
539
540
541
542
543
544
545







-
-
-
+
+
+





-
+

-
+



-
+

-
+



-
+

-
+








-
+

-
+












If you are behind a restrictive firewall that requires you to use
an HTTP proxy to reach the internet, then you can configure the proxy
in three different ways.  You can tell fossil about your proxy using
a command-line option on commands that use the network,
<b>sync</b>, <b>clone</b>, <b>push</b>, and <b>pull</b>.

<blockquote>
<b>fossil clone </b><i>URL</i>  <b>--proxy</b> <i>Proxy-URL</i>
</blockquote>
<pre>
<b>fossil clone </b><i>URL</i> <b>--proxy</b> <i>Proxy-URL</i>
</pre>

It is annoying to have to type in the proxy URL every time you
sync your project, though, so you can make the proxy configuration
persistent using the [/help/setting | setting] command:

<blockquote>
<pre>
<b>fossil setting proxy </b><i>Proxy-URL</i>
</blockquote>
</pre>

Or, you can set the "<b>http_proxy</b>" environment variable:

<blockquote>
<pre>
<b>export http_proxy=</b><i>Proxy-URL</i>
</blockquote>
</pre>

To stop using the proxy, do:

<blockquote>
<pre>
<b>fossil setting proxy off</b>
</blockquote>
</pre>

Or unset the environment variable.  The fossil setting for the
HTTP proxy takes precedence over the environment variable and the
command-line option overrides both.  If you have a persistent
proxy setting that you want to override for a one-time sync, that
is easily done on the command-line.  For example, to sync with
a co-worker's repository on your LAN, you might type:

<blockquote>
<pre>
<b>fossil sync http://192.168.1.36:8080/ --proxy off</b>
</blockquote>
</pre>

<h2 id="links">Other Resources</h2>

<ul>
<li> <a href="./gitusers.md">Hints For Users With Prior Git Experience</a>
<li> <a href="./whyusefossil.wiki">Why You Should Use Fossil</a>
<li> <a href="./history.md">The History and Purpose of Fossil</a>
<li> <a href="./branching.wiki">Branching, Forking, and Tagging</a>
<li> <a href="./hints.wiki">Fossil Tips and Usage Hints</a>
<li> <a href="./permutedindex.html">Comprehensive Fossil Doc Index</a>
</ul>