w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Accidentally branched off of the wrong branch, and when I want to merge into the master I have to merge both branches

One way to do it is, use cherry-pick. Do a git log branch2 and find the commit id's you want and then switch to master branch using git checkout master then use git cherry-pick <commit_id>

Refer to this post for more details

How to merge a specific commit in git





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.