Is it possible to make automatic synchronization of repositories, for example through pipline? I have 5 repositories Azure DevOps Which should be exactly the same as in Bitbucket (work in Bitbucket)
1 Answer
Auto copy in azure repo from bitbucket repo
Yes, we could use the Azure pipeline to sync Azure devops git repo with bitbucket repo.
Add a powershell task to execute the git command line to sync the changes:
git remote add bitbucket https://Username:[email protected]/xxx/xxxx.git HEAD:master git checkout $branch git push bitbucket $branch -f Besides, we could also enable the continuous integration for the pipeline, so that there is any changes in the Azure repo, it will synchronizes the changes to the bitbucket repo.
Please check this thread and this thread for some more details.
4 Comments
Сергей toff
thank you very much, I will study all info. There is a problem that these repositories already have azure.yml and some use Linux, it's not clear how to make another pipeline and use powershell
Сергей toff
oh. i can use one new pipline (and new repo) to sync all 5 repo?
Leo Liu
@Сергейtoff, Yes, you could so that. Just create a new folder and use git clone command line to clone all 5repo one by one, then sync it to the bitbucket repo.
Сергей toff
Are it way is bad? stackoverflow.com/questions/57908569/… Rest post for auto import?