2

I want to merge a branchA with the master branch such that in case of any conflict branch A overrides the master branch.

Basically I want to replace the master branch by branch A

Any idea?

Som Bhattacharyya
  • 3,972
  • 35
  • 54
Shagun Sodhani
  • 3,535
  • 4
  • 30
  • 41
  • 1
    Duplicate of http://stackoverflow.com/questions/2862590/how-to-replace-master-branch-in-git-entirely-from-another-branch – AnkitG Nov 09 '12 at 11:34

1 Answers1

4

you can try a:

git checkout master
git merge -Xtheirs branchA

(as described in "git merge -s ours, what about “their":
This would avoid the merge -ours from master to branchA, followed by the merge from branchA to master described in "How to replace master branch in git, entirely, from another branch?")

You also have various other options in "git command for making one branch like another"

As mentioned in "Git: Merge to master while automatically choosing to overwrite master files with branch", a reset would also be possible to completely replace master by branchA.

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