Skip to main content

Syncing GitLab repository to Bitbucket

Importing a project

  1. Go to GitLab
  2. New Project > Import Project > Repo by URL
  3. Enter the Bucket clone URL in Git repository URL
  4. Enter the Username and Password.
  5. Enter a Project name and Description.
  6. Click Create project

Mirroring GitLab repo to Bitbucket

  1. Go to the project created above.
  2. Settings > Repository > Mirroring repositories
  3. Add the bitbucket clone URL to Git repository URL. Format the url as <protocol>://<username>@<bitbucket URL>
  4. Put the bitbucket access token in the Password. Access token can be requested from bitbucket admin.
  5. Uncheck Keep divergent refs and Mirror only protected branches.
  6. Click Mirror repository

Changing the remote

Steps for terminal:

  1. git remote remove <old remote>

  2. git remote add <remote name> <remote URL>

  3. Add the bitbucket clone URL

    Note: For GUIs like Sourcetree and Gitkraken check their respective documentation.

  4. Pull to verify if everything is working.

Merge code from working branch to dev branch

You can merge you branch from your working branch to dev branch.

  1. You need to checkout on the dev branch.
  2. Merge dev branch to current branch.
  3. If there will be any confilict you need to resolve the same.
  4. Push the code.

Now your all code has been merged to the dev branch, Push branch to update all files on dev branch.

Change/add tag on dev branch

When all merge and conflict will be pushed and synced on the dev branch , you can change/add a tag on the same.

  1. Add new tag.
  2. Push all tag on dev branch.

And you tag will be pushed on gitlab.