Rename README to README.md
[fast-export.git] / README.md
blob9d007026ed83fbd8649c795d09510b63fea30a80
1 hg-fast-export.(sh|py) - mercurial to git converter using git-fast-import
3 Legal
4 =====
6 Most hg-* scripts are licensed under the MIT license[0] and were written
7 by Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and
8 #mercurial on freenode. hg-reset.py is licensed under GPLv2 since it
9 copies some code from the mercurial sources.
11 The current maintainer is Frej Drejhammar <frej.drejhammar@gmail.com>.
13 Usage
14 =====
16 Using hg-fast-export is quite simple for a mercurial repository <repo>:
18   mkdir repo-git # or whatever
19   cd repo-git
20   git init
21   hg-fast-export.sh -r <repo>
23 Please note that hg-fast-export does not automatically check out the
24 newly imported repository. You probably want to follow up the import
25 with a "git checkout"-command.
27 Incremental imports to track hg repos is supported, too.
29 Using hg-reset it is quite simple within a git repository that is
30 hg-fast-export'ed from mercurial:
32   hg-reset.sh -R <revision>
34 will give hints on which branches need adjustment for starting over
35 again.
37 When a mercurial repository does not use utf-8 for encoding author
38 strings and commit messages the "-e <encoding>" command line option
39 can be used to force fast-export to convert incoming meta data from
40 <encoding> to utf-8. This encoding option is also applied to file names.
42 In some locales Mercurial uses different encodings for commit messages
43 and file names. In that case, you can use "--fe <encoding>" command line
44 option which overrides the -e option for file names.
46 As mercurial appears to be much less picky about the syntax of the
47 author information than git, an author mapping file can be given to
48 hg-fast-export to fix up malformed author strings. The file is
49 specified using the -A option. The file should contain lines of the
50 form "FromAuthor=ToAuthor". The example authors.map below will
51 translate "User <garbage<user@example.com>" to "User <user@example.com>".
53 -- Start of authors.map --
54 User <garbage<user@example.com>=User <user@example.com>
55 -- End of authors.map --
57 Tag and Branch Naming
58 =====================
60 As Git and Mercurial have differ in what is a valid branch and tag
61 name the -B and -T options allow a mapping file to be specified to
62 rename branches and tags (respectively). The syntax of the mapping
63 file is the same as for the author mapping.
65 Notes/Limitations
66 =================
68 hg-fast-export supports multiple branches but only named branches with
69 exactly one head each. Otherwise commits to the tip of these heads
70 within the branch will get flattened into merge commits.
72 As each git-fast-import run creates a new pack file, it may be
73 required to repack the repository quite often for incremental imports
74 (especially when importing a small number of changesets per
75 incremental import).
77 The way the hg API and remote access protocol is designed it is not
78 possible to use hg-fast-export on remote repositories
79 (http/ssh). First clone the repository, then convert it.
81 Design
82 ======
84 hg-fast-export.py was designed in a way that doesn't require a 2-pass
85 mechanism or any prior repository analysis: if just feeds what it
86 finds into git-fast-import. This also implies that it heavily relies
87 on strictly linear ordering of changesets from hg, i.e. its
88 append-only storage model so that changesets hg-fast-export already
89 saw never get modified.
91 Submitting Patches
92 ==================
94 Please use the issue-tracker at github
95 https://github.com/frej/fast-export to report bugs and submit
96 patches.
98 Footnotes
99 =========
101 [0] http://www.opensource.org/licenses/mit-license.php