Fossil

Check-in [e8775afe]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add information to inout.wiki about bidirectional synchronization with Git repos.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nick.lloyd-git-interop
Files: files | file ages | folders
SHA1: e8775afe1b080bf8de97f4be76ec44db2cd69c2d
User & Date: nick.lloyd 2016-09-29 17:46:22
Context
2016-10-08
13:42
Add missing arguments to Git->Fossil import example. check-in: 880e3fb5 user: nick.lloyd tags: nick.lloyd-git-interop
2016-09-29
17:46
Add information to inout.wiki about bidirectional synchronization with Git repos. check-in: e8775afe user: nick.lloyd tags: nick.lloyd-git-interop
17:35
Remove comment from inout.wiki about having to merge trunk into master after importing from Git repo.

This is no longer true. Fossil automatically converts references to master into trunk when importing, and vice versa when exporting. check-in: 2cd0ee63 user: nick.lloyd tags: nick.lloyd-git-interop

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to www/inout.wiki.

46
47
48
49
50
51
52



















































As with the "import" command, the --git option is not required
since the git-fast-export file format is currently the only VCS interchange 
format that Fossil will generate.  However,
future versions of Fossil might add the ability to generate other
VCS interchange formats, and so for compatibility, the use of the --git 
option recommended.

























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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

As with the "import" command, the --git option is not required
since the git-fast-export file format is currently the only VCS interchange 
format that Fossil will generate.  However,
future versions of Fossil might add the ability to generate other
VCS interchange formats, and so for compatibility, the use of the --git 
option recommended.

<h2>Bidirectional Synchronization</h2>
Fossil also has the ability to synchronize with a Git repository via repeated
imports and/or exports.  To do this, it uses marks files to store a record of
artifacts which are known by both Git and Fossil to exist at a given point in
time.

To illustrate, consider the example of a remote Fossil repository that a
user wants to import into a local Git repository.  First, the user would clone
the remote repository and import it into a new Git repository:

<blockquote><pre>
fossil clone /path/to/remote/repo.fossil repo.fossil
mkdir repo
cd repo
fossil open ../repo.fossil
mkdir ../repo.git
cd ../repo.git
git init .
fossil export --git --export-marks ../repo/fossil.marks  \
       ../repo.fossil | git fast-import                  \
       --export-marks=../repo/git.marks
</pre></blockquote>

Once the import has completed, the user would need to <tt>git checkout
trunk</tt>.  At any point after this, new changes can be imported from the
remote Fossil repository:

<blockquote><pre>
cd ../repo
fossil pull
cd ../repo.git
fossil export --git --import-marks ../repo/fossil.marks  \
       --export-marks ../repo/fossil.marks               \
       ../repo.fossil | git fast-import                  \
       --import-marks=../repo/git.marks                  \
       --export-marks=../repo/git.marks
</pre></blockquote>

Changes in the Git repository can be exported to the Fossil repository and then
pushed to the remote:

<blockquote><pre>
git fast-export --import-marks=../repo/git.marks            \
    --export-marks=../repo/git.marks | fossil import --git  \
    --incremental --import-marks ../repo/fossil.marks       \
    --export-marks ../repo/fossil.marks
cd ../repo
fossil push
</pre></blockquote>