Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Start in a clean, up to date checkout of master
$ git checkout master

# Create v1 branch
$ git checkout -b v1

# Push v1 branch to GH
$ git push -u origin v1

# Delete local master branch
$ git branch -d master

# Delete remote master branch
$ git push origin :master

# Move revamp to master 🎉
$ git branch -m revamp master
$ git checkout master

# Push new master branch to GH
$ git push -u origin master
@olizilla

This comment has been minimized.

Copy link
Owner Author

olizilla commented Sep 24, 2018

nerp, just do https://stackoverflow.com/questions/2763006/make-the-current-git-branch-a-master-branch

git checkout better_branch
git merge --strategy=ours master    # keep the content of this branch, but record a merge
git checkout master
git merge better_branch             # fast-forward master up to the merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.