github - bit bucket mirroring

 
Requirement:
 
We have a project deployed using version controller github and need the same code in bitbucket with commit history and both repositories should be in synchronized as there is continuous deployment

# Clone the git repository that you want to merge to the bitbucket repository branch
git clone git@github.com:<github_user_name>/<github_repo_name>.git

# Rename origin to github
git remote rename origin github

#Add the bitbucket as a remote to the cloned repository. Replace<bitbucket_repo_url> with the URL of the bitbucket.
git remote add bit <bitbucket_repo_url>

#Fetch the branches and commits from the bitbucket
git fetch bit

#checkout to the bitbucket branch,
git checkout bit

#Attempt to merge the github into the bitbucket. Use the --allow-unrelated-histories flag to force Git to merge the unrelated histories.
git merge --allow-unrelated-histories bit/<branch_name>

#Resolve any merge conflicts and commit the changes and push the merged changes to the Bitbucket repository.
git push bit<branch_name>


For more insights and professional Odoo Community/Enterprise implementations, connect with us at hashcodeit.com or drop an email at info@hashcodeit.com, +971545975212.  Transform your Odoo journey with precision and expertise!

Comments

Popular posts from this blog

Odoo 17 - large database restore error

Complete Guide to Installing Odoo 17 on Digital Ocean with Ubuntu 22.04

Whhtmltopdf error