Switch Local commit from one branch to another

Sometimes we need to switch one commit from one branch to another. Then we need to execute following commands step by step.

git checkout branch_2
git merge branch_1
git checkout branch_1
git reset --hard HEAD~1 
git checkout branch_2 
reference : stackoverflow
Reactions

Post a Comment

2 Comments

  1. Many thanks for the exciting blog posting! I really appricateyou for this post. I actually added your blog to my favorites and will look forward for more updates. Great Job, Keep it up..
    recent technology news

    ReplyDelete