Giter Club home page Giter Club logo

bitbucket2git's Introduction

Batch migrating Mercurial (Hg) Bitbucket repositories to Git

WARNING!!!: Dont forget to git clone --recursive <project url> this repository as it includes fast-transform submodule that is required for scripts to work.

Since Bitbucket announced end of Mercurial support here is the instruction and scripts to help migrating multiple repositories from Bitbucket Mercurial (Hg) to Git.

Prerequisites: Bash, Python 2.

Please follow instructios below:

1. Configure Bitbucket to use SSH protocol

Follow instructions here

2. Collect list of repository names to repositories.txt

Using Scraper Chrome extension it is easy to extract repository names from Bitbucket web site. Put extracted repository names into repositories.txt file one line each.

3. Clone Mercurial repositories locally

Execute bash clone.sh prefix command, substituting prefix with your organisation or personal Bitbucket URL prefix. This will clone all repositories into ./hg/ folder locally.

4. Convert Mercurial repositories to Git

Execute bash transform.sh command to convert all Mercurial repositories in hg folder into Git repositories and output them to git folder. The proces will drop all non-merged unnamed heads from hg repositories, which is usually OK. If your repository is well maintained and merged nameless heads only represent abandoned lines of work.

.hgignore files has to be converted to .gitignore manually. Fortunately such conversion only needed if you continue to work on the project.

5. Configure Gitlab to use SSH

Create Gitlab account (if not already) and configure it to use SSH.

Create groups on Gitlab to match your organization names from Bitbucket.

6. Push new Git repositories to Gitlab

Execute bash push.sh prefix to push all repositories from git folder to Gitlab, substituting prefix with your Group name or personal URL prefix.

7. Repeat steps 2 - 6 for each organization in Bitbucket.

8. Say bye to Bitbucket.

bitbucket2git's People

Contributors

govorunov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.