0

I have two branches:
1. master
2. tmp

tmp branch is detached
I need to put tmp branch on top of master with resolving conflicts in priority of tmp ?

ButuzGOL
  • 1,233
  • 2
  • 13
  • 27
  • Branches cannot be "detached", only the symbolic reference `HEAD` can be "detached", from a branch. –  Apr 26 '14 at 19:21

1 Answers1

1

The term "detached" is generally reserved to "detached HEAD", where you have no branch name referencing a commit.

If you have a branch named "tmp", it isn't really detached.

The only interpretation I see for this "detached" state would be:

x--x--x     (master)
       \
       y--y (b1)
           \
            z--z--z (tmp)

(Here, tmp could be considered "detached" from master, as it doesn't directly stem from master, but from b1)

In which case, a rebase would look like

git checkout tmp
git rebase --onto master b1 tmp

In any case, you can pass a merge strategy to git rebase in order to resolve any conflict in favor of tmp content (as I mention in "Selecting merge strategy options for git rebase"):

git rebase -s recursive -X theirs
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250