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