Git rebase vs git cherry single branch selection

I have two branches:

  • master
  • Tmp

tmpbranch disconnected
I need to put the branch tmpon top masterwith conflict resolution in prioritytmp

When i do

git checkout tmp
git rebase --strategy=recursive -X theirs master

I got an error First rewind my head to play my work on top of it ...

fatal: Could not parse object '0a722ac51071ecb4d00b1ef45384aac227b942a0^'  
Unknown exit code (128) from command: git-merge-recursive 0a722ac51071ecb4d00b1ef45384aac227b942a0^ -- HEAD 0a722ac51071ecb4d00b1ef45384aac227b942a0  

When i do

git checkout tmp
git cherry-pick --strategy=recursive -X theirs 0a722ac..384144a 

Works fine

What is the difference or how can I do the same with rebase?

+2
source share
2 answers

You get an error rebasebecause you did not explicitly indicate which commit to start with, and because you explicitly indicated to her the merge call, she was looking for merge base 1 . To say, so as not to worry, just take the whole branch, specify --root:

git checkout tmp
git rebase --strategy=recursive -X theirs --root master

cherry-pick , , , . .. " -, ...", , " 0a722ac". - . cherry-pick , , - HEAD ( HEAD tmp, ):

git checkout master
git cherry-pick --strategy=recursive -X theirs  ..tmp

: rebase , .


1 , ( ) , , .

+7

A rebase : 0a722ac.

A cherry-pick : 0a722ac..384144a

0a722ac^ (, , 0a722ac ), rebase , ( 0a722ac) .

.

+2

All Articles