Branch a master repo and merge local copy
How does one merge a local master branch that has diverged from the master on the server with a new branch created from the current master branch on the repo?
I have been working on a local copy of a master branch and the status of the master branch is different to when I started working on the local copy. How do I merge my local copy into a fresh branch I want to create from the master branch?
I want to do this to push my local changes to the server for safety.
One Solution collect form web for “Branch a master repo and merge local copy”
First, start by creating a new branch at your local master:
git checkout master git branch my_feature_branch
Then, just move your local master to the upstream master
git branch -f master origin/master
And, push your new branch up:
git checkout my_feature_branch git push origin my_feature_branch