Fossil SCM
Add information to inout.wiki about bidirectional synchronization with Git repos.
Commit
e8775afe1b080bf8de97f4be76ec44db2cd69c2d
Parent
2cd0ee6388faaa0…
1 file changed
+50
+50
| --- www/inout.wiki | ||
| +++ www/inout.wiki | ||
| @@ -48,5 +48,55 @@ | ||
| 48 | 48 | since the git-fast-export file format is currently the only VCS interchange |
| 49 | 49 | format that Fossil will generate. However, |
| 50 | 50 | future versions of Fossil might add the ability to generate other |
| 51 | 51 | VCS interchange formats, and so for compatibility, the use of the --git |
| 52 | 52 | option recommended. |
| 53 | + | |
| 54 | +<h2>Bidirectional Synchronization</h2> | |
| 55 | +Fossil also has the ability to synchronize with a Git repository via repeated | |
| 56 | +imports and/or exports. To do this, it uses marks files to store a record of | |
| 57 | +artifacts which are known by both Git and Fossil to exist at a given point in | |
| 58 | +time. | |
| 59 | + | |
| 60 | +To illustrate, consider the example of a remote Fossil repository that a | |
| 61 | +user wants to import into a local Git repository. First, the user would clone | |
| 62 | +the remote repository and import it into a new Git repository: | |
| 63 | + | |
| 64 | +<blockquote><pre> | |
| 65 | +fossil clone /path/to/remote/repo.fossil repo.fossil | |
| 66 | +mkdir repo | |
| 67 | +cd repo | |
| 68 | +fossil open ../repo.fossil | |
| 69 | +mkdir ../repo.git | |
| 70 | +cd ../repo.git | |
| 71 | +git init . | |
| 72 | +fossil export --git --export-marks ../repo/fossil.marks \ | |
| 73 | + ../repo.fossil | git fast-import \ | |
| 74 | + --export-marks=../repo/git.marks | |
| 75 | +</pre></blockquote> | |
| 76 | + | |
| 77 | +Once the import has completed, the user would need to <tt>git checkout | |
| 78 | +trunk</tt>. At any point after this, new changes can be imported from the | |
| 79 | +remote Fossil repository: | |
| 80 | + | |
| 81 | +<blockquote><pre> | |
| 82 | +cd ../repo | |
| 83 | +fossil pull | |
| 84 | +cd ../repo.git | |
| 85 | +fossil export --git --import-marks ../repo/fossil.marks \ | |
| 86 | + --export-marks ../repo/fossil.marks \ | |
| 87 | + ../repo.fossil | git fast-import \ | |
| 88 | + --import-marks=../repo/git.marks \ | |
| 89 | + --export-marks=../repo/git.marks | |
| 90 | +</pre></blockquote> | |
| 91 | + | |
| 92 | +Changes in the Git repository can be exported to the Fossil repository and then | |
| 93 | +pushed to the remote: | |
| 94 | + | |
| 95 | +<blockquote><pre> | |
| 96 | +git fast-export --import-marks=../repo/git.marks \ | |
| 97 | + --export-marks=../repo/git.marks | fossil import --git \ | |
| 98 | + --incremental --import-marks ../repo/fossil.marks \ | |
| 99 | + --export-marks ../repo/fossil.marks | |
| 100 | +cd ../repo | |
| 101 | +fossil push | |
| 102 | +</pre></blockquote> | |
| 53 | 103 |
| --- www/inout.wiki | |
| +++ www/inout.wiki | |
| @@ -48,5 +48,55 @@ | |
| 48 | since the git-fast-export file format is currently the only VCS interchange |
| 49 | format that Fossil will generate. However, |
| 50 | future versions of Fossil might add the ability to generate other |
| 51 | VCS interchange formats, and so for compatibility, the use of the --git |
| 52 | option recommended. |
| 53 |
| --- www/inout.wiki | |
| +++ www/inout.wiki | |
| @@ -48,5 +48,55 @@ | |
| 48 | since the git-fast-export file format is currently the only VCS interchange |
| 49 | format that Fossil will generate. However, |
| 50 | future versions of Fossil might add the ability to generate other |
| 51 | VCS interchange formats, and so for compatibility, the use of the --git |
| 52 | option recommended. |
| 53 | |
| 54 | <h2>Bidirectional Synchronization</h2> |
| 55 | Fossil also has the ability to synchronize with a Git repository via repeated |
| 56 | imports and/or exports. To do this, it uses marks files to store a record of |
| 57 | artifacts which are known by both Git and Fossil to exist at a given point in |
| 58 | time. |
| 59 | |
| 60 | To illustrate, consider the example of a remote Fossil repository that a |
| 61 | user wants to import into a local Git repository. First, the user would clone |
| 62 | the remote repository and import it into a new Git repository: |
| 63 | |
| 64 | <blockquote><pre> |
| 65 | fossil clone /path/to/remote/repo.fossil repo.fossil |
| 66 | mkdir repo |
| 67 | cd repo |
| 68 | fossil open ../repo.fossil |
| 69 | mkdir ../repo.git |
| 70 | cd ../repo.git |
| 71 | git init . |
| 72 | fossil export --git --export-marks ../repo/fossil.marks \ |
| 73 | ../repo.fossil | git fast-import \ |
| 74 | --export-marks=../repo/git.marks |
| 75 | </pre></blockquote> |
| 76 | |
| 77 | Once the import has completed, the user would need to <tt>git checkout |
| 78 | trunk</tt>. At any point after this, new changes can be imported from the |
| 79 | remote Fossil repository: |
| 80 | |
| 81 | <blockquote><pre> |
| 82 | cd ../repo |
| 83 | fossil pull |
| 84 | cd ../repo.git |
| 85 | fossil export --git --import-marks ../repo/fossil.marks \ |
| 86 | --export-marks ../repo/fossil.marks \ |
| 87 | ../repo.fossil | git fast-import \ |
| 88 | --import-marks=../repo/git.marks \ |
| 89 | --export-marks=../repo/git.marks |
| 90 | </pre></blockquote> |
| 91 | |
| 92 | Changes in the Git repository can be exported to the Fossil repository and then |
| 93 | pushed to the remote: |
| 94 | |
| 95 | <blockquote><pre> |
| 96 | git fast-export --import-marks=../repo/git.marks \ |
| 97 | --export-marks=../repo/git.marks | fossil import --git \ |
| 98 | --incremental --import-marks ../repo/fossil.marks \ |
| 99 | --export-marks ../repo/fossil.marks |
| 100 | cd ../repo |
| 101 | fossil push |
| 102 | </pre></blockquote> |
| 103 |