|
be93ecb…
|
stephan
|
1 |
<title>Up and running in 5 minutes as a single user</title> |
|
66c4f17…
|
drh
|
2 |
|
|
66c4f17…
|
drh
|
3 |
<p align="center"><b><i> |
|
66c4f17…
|
drh
|
4 |
The following document was contributed by Gilles Ganault on 2013-01-08. |
|
66c4f17…
|
drh
|
5 |
</i></b> |
|
66c4f17…
|
drh
|
6 |
</p><hr> |
|
66c4f17…
|
drh
|
7 |
|
|
be93ecb…
|
stephan
|
8 |
<h1>Up and running in 5 minutes as a single user</h1> |
|
262eb51…
|
wyoung
|
9 |
|
|
262eb51…
|
wyoung
|
10 |
This short document explains the main basic Fossil commands for a single |
|
f47b705…
|
jan.nijtmans
|
11 |
user, i.e. with no additional users, with no need to synchronize with some remote |
|
262eb51…
|
wyoung
|
12 |
repository, and no need for branching/forking. |
|
0fb6c82…
|
stephan
|
13 |
|
|
66c4f17…
|
drh
|
14 |
<h2>Create a new repository</h2> |
|
262eb51…
|
wyoung
|
15 |
|
|
262eb51…
|
wyoung
|
16 |
<tt>fossil new c:\test.repo</tt> |
|
262eb51…
|
wyoung
|
17 |
|
|
262eb51…
|
wyoung
|
18 |
This will create the new SQLite binary file that holds the repository, i.e. |
|
f47b705…
|
jan.nijtmans
|
19 |
files, tickets, wiki, etc. It can be located anywhere, although it's considered |
|
f47b705…
|
jan.nijtmans
|
20 |
best practice to keep it outside the work directory where you will work on files |
|
262eb51…
|
wyoung
|
21 |
after they've been checked out of the repository. |
|
0fb6c82…
|
stephan
|
22 |
|
|
66c4f17…
|
drh
|
23 |
<h2>Open the repository</h2> |
|
262eb51…
|
wyoung
|
24 |
|
|
262eb51…
|
wyoung
|
25 |
<tt>cd c:\temp\test.fossil |
|
262eb51…
|
wyoung
|
26 |
<br> |
|
262eb51…
|
wyoung
|
27 |
fossil open c:\test.repo</tt> |
|
262eb51…
|
wyoung
|
28 |
|
|
262eb51…
|
wyoung
|
29 |
This will check out the last revision of all the files in the repository, |
|
f47b705…
|
jan.nijtmans
|
30 |
if any, into the current work directory. In addition, it will create a binary |
|
be93ecb…
|
stephan
|
31 |
file _FOSSIL_ to keep track of changes (on non-Windows systems it is called |
|
262eb51…
|
wyoung
|
32 |
<tt>.fslckout</tt>). |
|
0fb6c82…
|
stephan
|
33 |
|
|
66c4f17…
|
drh
|
34 |
<h2>Add new files</h2> |
|
262eb51…
|
wyoung
|
35 |
|
|
262eb51…
|
wyoung
|
36 |
<tt>fossil add .</tt> |
|
262eb51…
|
wyoung
|
37 |
|
|
262eb51…
|
wyoung
|
38 |
To tell Fossil to add new files to the repository. The files aren't actually |
|
262eb51…
|
wyoung
|
39 |
added until you run "<tt>fossil commit</tt>. When using ".", it tells Fossil |
|
f47b705…
|
jan.nijtmans
|
40 |
to add all the files in the current directory recursively, i.e. including all |
|
262eb51…
|
wyoung
|
41 |
the files in all the subdirectories. |
|
262eb51…
|
wyoung
|
42 |
|
|
262eb51…
|
wyoung
|
43 |
Note: To tell Fossil to ignore some extensions: |
|
262eb51…
|
wyoung
|
44 |
|
|
262eb51…
|
wyoung
|
45 |
<tt>fossil settings ignore-glob "*.o,*.obj,*.exe" --global</tt> |
|
fe38a76…
|
drh
|
46 |
|
|
fe38a76…
|
drh
|
47 |
<h2>Remove files that haven't been committed yet</h2> |
|
262eb51…
|
wyoung
|
48 |
|
|
262eb51…
|
wyoung
|
49 |
<tt>fossil delete myfile.c</tt> |
|
262eb51…
|
wyoung
|
50 |
|
|
262eb51…
|
wyoung
|
51 |
This will simply remove the item from the list of files that were previously |
|
262eb51…
|
wyoung
|
52 |
added through "<tt>fossil add</tt>". |
|
0fb6c82…
|
stephan
|
53 |
|
|
66c4f17…
|
drh
|
54 |
<h2>Check current status</h2> |
|
262eb51…
|
wyoung
|
55 |
|
|
262eb51…
|
wyoung
|
56 |
<tt>fossil changes</tt> |
|
262eb51…
|
wyoung
|
57 |
|
|
262eb51…
|
wyoung
|
58 |
This shows the list of changes that have been done and will be committed the |
|
262eb51…
|
wyoung
|
59 |
next time you run "<tt>fossil commit</tt>". It's a useful command to run before |
|
262eb51…
|
wyoung
|
60 |
running "<tt>fossil commit</tt>" just to check that things are OK before proceeding. |
|
0fb6c82…
|
stephan
|
61 |
|
|
66c4f17…
|
drh
|
62 |
<h2>Commit changes</h2> |
|
262eb51…
|
wyoung
|
63 |
|
|
262eb51…
|
wyoung
|
64 |
To actually apply the pending changes to the repository, e.g. new files marked |
|
f47b705…
|
jan.nijtmans
|
65 |
for addition, checked-out files that have been edited and must be checked-in, |
|
262eb51…
|
wyoung
|
66 |
etc. |
|
0fb6c82…
|
stephan
|
67 |
|
|
262eb51…
|
wyoung
|
68 |
<tt>fossil commit -m "Added stuff"</tt> |
|
0fb6c82…
|
stephan
|
69 |
|
|
0fb6c82…
|
stephan
|
70 |
If no file names are provided on the command-line then all changes will be checked in, |
|
0fb6c82…
|
stephan
|
71 |
otherwise just the listed file(s) will be checked in. |
|
0fb6c82…
|
stephan
|
72 |
|
|
66c4f17…
|
drh
|
73 |
<h2>Compare two revisions of a file</h2> |
|
262eb51…
|
wyoung
|
74 |
|
|
262eb51…
|
wyoung
|
75 |
If you wish to compare the last revision of a file and its checked out version |
|
262eb51…
|
wyoung
|
76 |
in your work directory: |
|
262eb51…
|
wyoung
|
77 |
|
|
262eb51…
|
wyoung
|
78 |
<tt>fossil gdiff myfile.c</tt> |
|
262eb51…
|
wyoung
|
79 |
|
|
262eb51…
|
wyoung
|
80 |
If you wish to compare two different revisions of a file in the repository: |
|
262eb51…
|
wyoung
|
81 |
|
|
262eb51…
|
wyoung
|
82 |
<tt>fossil finfo myfile</tt> |
|
262eb51…
|
wyoung
|
83 |
|
|
262eb51…
|
wyoung
|
84 |
Note the first hash, which is the hash of the commit |
|
262eb51…
|
wyoung
|
85 |
when the file was committed. |
|
262eb51…
|
wyoung
|
86 |
|
|
262eb51…
|
wyoung
|
87 |
<tt>fossil gdiff --from HASH#1 --to HASH#2 myfile.c</tt> |
|
262eb51…
|
wyoung
|
88 |
|
|
f6e6353…
|
drh
|
89 |
<h2>Cancel changes and go back to previous revision</h2> |
|
262eb51…
|
wyoung
|
90 |
|
|
262eb51…
|
wyoung
|
91 |
<tt>fossil revert myfile.c</tt> |
|
262eb51…
|
wyoung
|
92 |
|
|
262eb51…
|
wyoung
|
93 |
Fossil does not prompt when reverting a file. It simply reminds the user about the |
|
262eb51…
|
wyoung
|
94 |
"undo" command, just in case the revert was a mistake. |