Reputation: 415
Using Azure DevOps, there is a repo with valid code being maintained in a secondary branch. However, the master branch is multiple years out of date.
I want to obliterate the contents of master and overwrite it with the contents of the secondary branch.
I understand that mishandling this can cause serious namespaces issues and I would like to avoid that.
What method would you recommend for completely replacing master with a secondary branch in Azure DevOps?
Upvotes: 6
Views: 6866
Reputation: 41575
Clone the repo to your local machine.
git clone {repo url}
Go to the local repo and move to the secondary branch.
git checkout {secondary branch}
Copy all the content - Ctrl+A
, Ctrl+C
.
Move back to master branch.
git checkout master
Paste the files (and replace existing files) Ctrl+V
.
Commit the changes.
git add .
git commit -m "update master"
Push the changes to Azure DevOps.
git push
Now the master
branch updated with the content of the secondary branch
.
Upvotes: 8