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
  • 79,096
  • 23
  • 144
  • 182
locoboy
  • 36,684
  • 67
  • 180
  • 255
  • 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
  • 210,715
  • 34
  • 410
  • 462