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