Mercurial (Hg) code base migrated to Git

Source: Internet
Author: User
Tags mercurial git clone

Using Open Source Tools Fast-export
Mercurial code base directory is/home/code_mercurial


The steps are as follows:
1. Download Fast-export
$git Clone Git://repo.or.cz/fast-export.git
Assuming the download is in the home directory, the directory structure is/home/fast-export


2. Create a new directory and initialize it to a git repository
$mkdir Code_git
$CD Code_git
$git Init


3. Convert using the Fast-export tool
Under the Code_git directory
$/home/fast-export/hg-fast-export.sh-r/home/code_mercurial
If you encounter error:repository have at least one unnamed head: ... Do the following two things:
1) Execute in code_mercurial directory
$HG bookmark-r default Master # make a bookmark of master for default, so a ref gets created
Then push and pull again.
2) If you still report an error, add the Force parameter, so
$/home/fast-export/hg-fast-export.sh-r/home/code_mercurial--force


4. In the Code_git directory execution
git reset HEAD


Get.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.