0

Using git locally, I merged from branch D into branch M. But what I want is branch M merged into D. That is, I want to set D to become the active branch and have it reflect the merge. I tried to set the current branch to D based on suggestions in this question: Make an existing Git branch track a remote branch?

git push -u origin D

error: failed to push some refs to 'url'

New to git and not sure if I'm barking up the right tree. Ideally, I'd also like to leave M origin as-was (i.e. not push the merge to it).

Dyneken
  • 111
  • 1
  • 2
  • 7

1 Answers1

0
  1. Discard merge commit, could be done as answered here.
  2. Execute git checkout D.
  3. Execute git merge M.
  4. Push M branch to another remote branch, so origin M branch will be not upstream branch anymore, like git push -u origin M-modified.
kosist
  • 2,868
  • 2
  • 17
  • 30