Forum Discussion
drhorg2230
Jun 09, 2024Copper Contributor
Sync 2 Git repos
I cloned a month ago a Github public repo directly into a new private Azure DevOps repo, by using https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?view=azure-devops ,...
Kidd_Ip
Jul 05, 2025MVP
Consider the following as well:
- Force Push May Be Required
If you've already pushed main or DEV to Azure DevOps before rebasing, a regular git push may fail. In that case, use:
git push --force-with-lease origin main
git push --force-with-lease origin DEV
This is safer than --force because it ensures you don’t overwrite someone else’s work.
- Avoid Rebasing Shared Branches
If other developers are working on the same branches, rebasing and force-pushing can cause conflicts for them. In that case, consider using git merge instead of rebase.
- Automate the Sync
If you want to keep GitHub and Azure DevOps in sync continuously, consider:
- GitHub Actions to push changes to Azure DevOps on every commit.
- Azure Pipelines to pull from GitHub and push to Azure DevOps.