1

I have a xyz remote Branch in Azure Devops and I want to replace master Remote Branch with this Branch.

Meaning: My master Remote Branch data will be replaced with XYZ Branch.
How is it Possible ?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
NumanCS
  • 87
  • 1
  • 9

1 Answers1

0

One easy approach is to:

  • clone your DevOps Azure repository locally
  • rename your master branch to old, rename your XYZ branch to master
  • force push

See this approach illustrated here.
But that would replace all commits from masters by the ones from XYZ.

If you just want to replace master files, while keeping its original history, use git merge -s ours (as seen here)

In both instances, making sure the end result is the one you expect locally, before pushing back, is the recommended approach.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250