Skip to content

Instantly share code, notes, and snippets.

@hectorromo
Forked from rgbink/git_overwrite_branch
Created March 15, 2020 03:17
Show Gist options
  • Save hectorromo/e2d5d032f6871bfdcda5c95ce03f9de9 to your computer and use it in GitHub Desktop.
Save hectorromo/e2d5d032f6871bfdcda5c95ce03f9de9 to your computer and use it in GitHub Desktop.
Completely Overwrite chosen git branch
git checkout desired_branch // put in the name of the branch you wish to KEEP
git merge -s ours branch_to_be_replaced // put in the name of the branch you want to OVERWRITE
git checkout branch_to_be_replaced // put in the name of the branch you want to OVERWRITE
git merge desired_branch // put in the name of the branch you wish to KEEP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment