-
-
Save ummahusla/8ccfdae6fbbe50171d77 to your computer and use it in GitHub Desktop.
Git overwrite branch with another branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# overwrite master with contents of feature branch (feature > master) | |
git checkout feature # source name | |
git merge -s ours master # target name | |
git checkout master # target name | |
git merge feature # source name |
That still leaves non-conflicting stuff in master. Say i deleted shit in seotweaks but master still has them, the merge will let master keep it because it doesn't conflict, it's just master "adding" things.
git checkout -B master anotherbranch
See https://stackoverflow.com/a/29871400/148680
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Approved, that works! Thanks