smeeb
smeeb

Reputation: 29577

Possible to force merge a feature branch in git/GitHub

I've got a GitHub repo that loosely follows git-flow. There are two long-standing branches: master and develop. A feature branch (feature/one) was cut off of develop some time ago. A PR exists to merge feature/one back into develop, however there are lots of merge conflicts.

I'm 100% certain that I want all the changes in feature/one to trump and override any conflicts from develop. Is there any way to force git to just say "Hey, anything that's conflicting in feature/one and develop, just use the changes from feature/one" ?

Upvotes: 2

Views: 393

Answers (1)

Shuwn Yuan Tee
Shuwn Yuan Tee

Reputation: 5748

During merging from feature/one into develop branch, you can use this:

git checkout develop
git merge -X theirs feature/one

The long form for -X theirs is --strategy-option=theirs. So the longer form is:

git merge --strategy-option=theirs feature/one

You can refer the git merge man page.

Upvotes: 4

Related Questions