Syncing GitLab repository to Bitbucket
Importing a project
- Go to GitLab
New Project > Import Project > Repo by URL
- Enter the Bucket clone URL in Git repository URL
- Enter the Username and Password.
- Enter a Project name and Description.
- Click Create project
Mirroring GitLab repo to Bitbucket
- Go to the project created above.
Settings > Repository > Mirroring repositories
- Add the bitbucket clone URL to Git repository URL. Format the url as
<protocol>://<username>@<bitbucket URL>
- Put the bitbucket access token in the Password. Access token can be requested from bitbucket admin.
- Uncheck Keep divergent refs and Mirror only protected branches.
- Click Mirror repository
Changing the remote
Steps for terminal:
git remote remove <old remote>
git remote add <remote name> <remote URL>
Add the bitbucket clone URL
Note: For GUIs like Sourcetree and Gitkraken check their respective documentation.
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.
- You need to checkout on the dev branch.
- Merge dev branch to current branch.
- If there will be any confilict you need to resolve the same.
- 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.
- Add new tag.
- Push all tag on dev branch.
And you tag will be pushed on gitlab.