0

I have to sync two branches, but it is having merge conflicts. There is a lot merge conflicts are there. So resolving all is not possible. Is there any other way, so we can sync?

There is 2 branch release/uat, release/preprod need to sync this two, but not possible to do, manually resolve conflicts.

Swaraj
  • 9
  • 2
  • How did you come to have these two branches in this state? It’s not clear what you are asking but `How to sync two branches, without doing a new commit` this is impossible. `So resolving all is not possible` I doubt that’s true since that is “the way” - but why not? Please edit the question to add specific details, questions that are just a description are generally too vague to answer. – AD7six Feb 02 '23 at 07:07

1 Answers1

0

It depends what you need by "syncing" those two branches.

Conflicts means concurrent development, but if you need branchB to reflect branchA (instead of merging branchA into branchB and resolving all conflict, you can make branchB like branchA.

See for instance "git command for making one branch like another"

git switch -c tmp branchA
git merge -s ours branchB       # ignoring all changes from branchB
git checkout branchB
git merge tmp                   # fast-forward to tmp HEAD
git branch -D tmp               # deleting tmp

Anything else would mean resolving conflicts.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Curious to see if your spideysense guessed right here :). Merging UAT into preproduction and (likely) ignoring patches applied in UAT sounds like a pretty dangerous thing to do. – AD7six Feb 02 '23 at 07:12
  • @AD7six Agreed. But for me, "not resolving merge conflict" means only one thing: make one branch like the other. – VonC Feb 02 '23 at 07:25