This app transfers all of your Bitbucket repositories to Github while maintaining their privacy status.
For each repository, the app will perform the following:
- Clone all branches of the repository from Bitbucket;
- Create the repository with the same name on GitHub;
- Rename
master
branch tomain
; - Create a placeholder
master
branch with no history to avoid accidental pushes; - Push all branches to GitHub;
- Grant write permissions for a team if the repository belongs to an organization and the GITHUB_TEAM environment variable is set;
- Configure branch protection rules for the
main
branch and the placeholdermaster
branch; - Archive the repository if it was last updated more than one year ago;
- Delete repository on Bitbucket and set up a redirect notification with the new GitHub URL;
This app includes a Docker configuration that automatically installs all required dependencies.
Important! Before starting the migration, review the src/index.ts
file and
comment out the functions with the steps you don't wish to perform.
-
Clone this repository:
git clone https://github.com/the-vaan-group/bitbucket-to-github.git
-
In the repository folder, create an environment variable file from the template:
cp -iv .env.template .env
-
Set the environment variables' values in the
.env
file. -
Start the Docker container:
./docker-up.sh
-
After the Docker container is created, you should see the container's shell prompt. To start the migration type the following in the new shell prompt:
npm run start