Created
July 6, 2018 22:28
-
-
Save brunnogomes/47655eb4a5360e3906b2a2dba2bfff6d to your computer and use it in GitHub Desktop.
Promote alternate git branch to master 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
# We actually don't need to do that. | |
# Even if the branches are very different and you don't wanto resolve a ton of conflicts. | |
# Using the strategy argument in the merge command, you can instruct git to just use | |
# tha state in the current branch and do the merge, preserving all the history. | |
git checkout alternate_branch | |
git merge --strategy=ours master # keep the content of this branch, but record a merge | |
git checkout master | |
git merge alternate_branch # fast-forward master up to the merge | |
# Now you can delete the alternate_branch and go back to using master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment