1GIT-REMOTE-HG(1) GIT-REMOTE-HG(1)
2
3
4
6 git-remote-hg - bidirectional bridge between Git and Mercurial
7
9 git clone hg::<hg repository>
10
12 This tool allows you to transparently clone, fetch and push to and from
13 Mercurial repositories as if they were Git ones.
14
15 To use it you simply need to use the "hg::" prefix when specifying a
16 remote URL (e.g. when cloning).
17
19 $ git clone hg::http://selenic.com/repo/hello
20
22 If you want to see Mercurial revisions as Git commit notes:
23
24 % git config core.notesRef refs/notes/hg
25
26 If you are not interested in Mercurial permanent and global branches
27 (aka. commit labels):
28
29 % git config --global remote-hg.track-branches false
30
31 With this configuration, the branches/foo refs won’t appear.
32
33 If you want the equivalent of hg clone --insecure:
34
35 % git config --global remote-hg.insecure true
36
37 If you want git-remote-hg to be compatible with hg-git, and generate
38 exactly the same commits:
39
40 % git config --global remote-hg.hg-git-compat true
41
43 Remember to run git gc --aggressive after cloning a repository,
44 specially if it’s a big one. Otherwise lots of space will be wasted.
45
46 The oldest version of Mercurial supported is 1.9. For the most part 1.8
47 works, but you might experience some issues.
48
49 Pushing branches
50 To push a Mercurial named branch, you need to use the "branches/"
51 prefix:
52
53 % git checkout branches/next
54 # do stuff
55 % git push origin branches/next
56
57 All the pushed commits will receive the "next" Mercurial named branch.
58
59 Note: Make sure you don’t have remote-hg.track-branches disabled.
60
61 Cloning HTTPS
62 The simplest way is to specify the user and password in the URL:
63
64 git clone hg::https://user:password@bitbucket.org/user/repo
65
66 You can also use the schemes extension:
67
68 [auth]
69 bb.prefix = https://bitbucket.org/user/
70 bb.username = user
71 bb.password = password
72
73 Finally, you can also use the keyring extension.
74
76 The only major incompatibility is that Git octopus merges (a merge with
77 more than two parents) are not supported.
78
79 Mercurial branches and bookmarks have some limitations of Git branches:
80 you can’t have both dev/feature and dev (as Git uses files and
81 directories to store them).
82
83 Multiple anonymous heads (which are useless anyway) are not supported;
84 you would only see the latest head.
85
86 Closed branches are not supported; they are not shown and you can’t
87 close or reopen. Additionally in certain rare situations a
88 synchronization issue can occur (Bug #65).
89
90
91
92 07/13/2018 GIT-REMOTE-HG(1)