Git Move Not-Pushed Commit from temp to master branch

95 Views Asked by At

How do I get from this

A -- B -- C [masterbranch, origin/HEAD, origin/master, HEAD]
      \
       D -- E -- F [tempbranch]

to this:

A -- B -- C -- F [masterbranch ,origin/HEAD, origin/master, HEAD]
   \
    D -- E [tempbranch]

I don't want to deal with merging, just have 100% from commit F as the end point of my master-branch.

1

There are 1 best solutions below

3
On BEST ANSWER

Simply use git cherry-pick to apply the commit to your master branch. This commands should produce the desired situation:

git cherry-pick <id of F>
git checkout tempbranch
git reset --hard HEAD~1
git checkout masterbranch
git push