git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: hg2git error

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Jul 22, 2009, 18:05 UTC
Message-ID
<fabb9a1e0907221105n319391es3c928b1bcab4e86a@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0907221946590.7343@intel-tinevez-2-302>
Heya,

On Wed, Jul 22, 2009 at 17:47, Johannes Schindelin<Johannes.Schindelin@gmx.de> wrote:

> Could you give me a quick run-through how to install it and use it to
> mirror, say, the netbeans repository?

Sure, feel free to ping me on IRC if you have any questions, I'll explain my workflow for Melange, I reckon you can adapt it to suit your needs.

1. clone hg-git
```
mkdir ~/code
git clone git://github.com/schacon/hg-git.git ~/code
```
2. edit your .hgrc to include the following to turn on the hg-git
plugin, and the bookmarks plugin which hg-git likes to use to store
branches from your git repository:
```
[extensions]
hgext.bookmarks =
git = ~/code/hg-git
```
3. hg clone the repository of your choice, I'll pretend it's ~/code/Melange
4. add the following to ~/code/Melange/.hg/hgrc:
```
[git]
intree=1
```
5. if possible, add '.git' to .hgignore, if not possible you'll just
have to live with it showing up in 'hg status'
6. run `hg gexport`, this will create a ~/code/Melange/.git which is a
regular git repository
7. add .hg to ~/code/Melange/.git/info/exclude
8. now each time you want to pull in new hg updates, run 'hg pull && hg gexport'
9. Depending on your preferences, you might want to add the following
to your ~/code/Melange/.hg/hgrc below intree=1:
```
exportbranch=refs/heads/from-hg
```
Doing so will cause `hg gexport` to override the 'from-hg' branch
instead of 'refs/heads/master', allowing you to work in the git
repository without worrying about losing any changes when you run `hg
gexport`.
10. Push from the git repository as usual:
```
git remote add origin ssh://srabbelier@repo.or.cz/srv/git/Melange.git
git push origin master
```
If you have any questions, feel free to ask :).
-- 
Cheers,

Sverre Rabbelier
Previous: Johannes SchindelinNext: Rocco Rutte
Message 6 of 10 in “hg2git error”
  1. Johannes SchindelinMay 24, 2009
  2. Sverre RabbelierMay 24, 2009
  3. Johannes SchindelinMay 24, 2009
  4. Sverre RabbelierMay 24, 2009
  5. Johannes SchindelinJul 22, 2009
  6. Sverre RabbelierJul 22, 2009
  7. Rocco RutteMay 25, 2009
  8. Johannes SchindelinMay 25, 2009
  9. Matthieu MoyMay 25, 2009
  10. Rocco RutteMay 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.