Skip to content

Instantly share code, notes, and snippets.

@olizilla
Created September 24, 2018 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olizilla/6aa9792568dde362ff9b558c4121348c to your computer and use it in GitHub Desktop.
Save olizilla/6aa9792568dde362ff9b558c4121348c to your computer and use it in GitHub Desktop.
# 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
Copy link
Author

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