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)
Asked
Active
Viewed 737 times
1 Answers
0
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:password@bitbucket.org/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.

Leo Liu
- 71,098
- 10
- 114
- 135
-
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 Aug 31 '20 at 18:09
-
oh. i can use one new pipline (and new repo) to sync all 5 repo? – Сергей toff Aug 31 '20 at 18:11
-
@Сергей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. – Leo Liu Sep 01 '20 at 01:24
-
Are it way is bad? https://stackoverflow.com/questions/57908569/is-there-a-way-to-script-repetitive-tasks-in-azure-devops Rest post for auto import? – Сергей toff Sep 07 '20 at 10:24