I have two repository, first on Azure DevOps, second on GitHub. I'd like to update GitHub repository to have the same code on both repositories. How can I do it without manually copying source code?
You can include a Pipeline step that runs git, to copy the repo over. Something like this:
steps:
- bash: |
git push --prune https://$(GITHUB_PAT)@github.com/$REPO_NAME \
+refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*
displayName: 'Copy to Github'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
(Copied from https://github.com/Azure/AzureStor/blob/master/azure-pipelines.yml, slightly modified)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With