Skip to content

Instantly share code, notes, and snippets.

@bultas
Created March 18, 2015 21:24
Show Gist options
  • Save bultas/3fcd11d8e5e31e93562d to your computer and use it in GitHub Desktop.
Save bultas/3fcd11d8e5e31e93562d to your computer and use it in GitHub Desktop.
GIT - how to replace master branch with another branch
http://stackoverflow.com/questions/2862590/how-to-replace-master-branch-in-git-entirely-from-another-branch
You should be able to use the "ours" merge strategy to overwrite master with AnotherBranch like this:
git checkout AnotherBranch
git merge -s ours master
git checkout master
git merge AnotherBranch
The result should be your master is now essentially AnotherBranch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment