Sync 2 Git repos
git switch main
git checkout -b DEV
#add 2 new yaml files and update 2 files
Git add .
Git commit -m “Added and Updated Config files”
Git remote add github https://github.com/Software/Project.git
git push -u origin DEV
git switch main
git rebase github/main
git push -u origin main
git switch DEV
git rebase github/main
git push -u origin DEV
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 , because we are implementing new software which is hosted in a Github public repo. The reason for saving the code also in ADO is since we have few parameter files that we need to modify. After this original clone directly from GitHub to ADO, I cloned locally on my laptop and created a new branch for DEV based on main, by adding one commit that contain 4 yaml files : 2 new parameter files and 2 updated files. Then pushed DEV branch to ADO. git clone https://ContosoOrg/Project/_git/RepoName
git switch main
git checkout -b DEV
#add 2 new yaml files and update 2 files
Git add .
Git commit -m “Added and Updated Config files”
Git remote add github https://github.com/Software/Project.git
git push -u origin DEVIn the meantime in Github there were 4 additional commits on the main. I need to update both the main and DEV branches in ADO based on Github main branch changes, now and in future for any further Github new commits. I am fairly new to Git but reviewed the documentation in depth. I very much appreciate if you check following steps and let me know if make sense, or you see an issue. git fetch github
git switch main
git rebase github/main
git push -u origin main
git switch DEV
git rebase github/main
git push -u origin DEV Read More