Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link

olizilla commented Sep 24, 2018

nerp, just do

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