Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Merge Recursive Ours - Command Syntax Example

What is the right format for a git merge with a strategy of recursive ours? (not to be confused with the git merge ours strategy)

http://www.kernel.org/pub/software/scm/git/docs/git-merge.html

I tried a bunch of ways and it doesn't seem to work.

git merge foo -s recursive-ours  // doesn't work git merge foo -s recursive ours // doesn't work git merge foo -s recursive -ours // doesn't work ... 
like image 534
Quang Van Avatar asked Aug 13 '10 04:08

Quang Van


People also ask

What is recursive merging in git?

Recursive is the default merge strategy when pulling or merging one branch. Additionally this can detect and handle merges involving renames, but currently cannot make use of detected copies. This is the default merge strategy when pulling or merging one branch.

How do you solve merge by recursive strategy?

You can use git merge-base --all to see the merge base candidate commits. Using -s resolve will pick one of them, while -s recursive will take all of them, merge them into a new commit, and use that new commit as the merge base.

What is git merge command?

The git merge command lets you take the independent lines of development created by git branch and integrate them into a single branch. Note that all of the commands presented below merge into the current branch.

How do I manually merge in git?

To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch. This example merges the jeff/feature1 branch into the main branch.


1 Answers

git merge -s recursive -X ours foo

like image 78
Gabe Moothart Avatar answered Oct 05 '22 23:10

Gabe Moothart