Merging Changes from another Local Branch

John Peters - Sep 1 '20 - - Dev Community

But...officer the ship is still salvagable!

Scenario:

We make a bunch of changes and commit them only to find out we were on the master branch. How do we solve this problem? Any attempts to push to master are never allowed.

git checkout -b 'NewBranchName'
// should be in that branch now
git merge master
// all the commits on master are brought over to new branch
git push
//all changes are pushed up via the new branch!

Enter fullscreen mode Exit fullscreen mode

Ah, yes! We saved the ship from sinking.

JWP2020

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player