0

I have master and a branch off of master called develop. I made a lot of changes in develop branch such that there are a lot of conflicts with master. I would like to force merge develop into master so that develop becomes master.

Whats the best way to do this in git?

I tried:

$git checkout branch
$get push origin master -f

but that doesn't seem to work.

David Grayson
  • 84,103
  • 24
  • 152
  • 189
locoboy
  • 38,002
  • 70
  • 184
  • 260
  • Possible duplicate? http://stackoverflow.com/questions/2763006/change-the-current-branch-to-master-in-git – EpicDavi Jul 12 '14 at 03:33

1 Answers1

2

You can use the fully-specified push syntax:

git push -f origin develop:master

Note that you may cause problems for people who have clones of your repo; this kind of history rewriting is generally frowned upon.

Carl Norum
  • 219,201
  • 40
  • 422
  • 469