Skip to content

Instantly share code, notes, and snippets.

@AnoRebel
Forked from ummahusla/git-overwrite-branch.sh
Created November 2, 2020 16:02
Show Gist options
  • Save AnoRebel/6439c5123f2a31f2cb43399b17cff86e to your computer and use it in GitHub Desktop.
Save AnoRebel/6439c5123f2a31f2cb43399b17cff86e to your computer and use it in GitHub Desktop.
Git overwrite branch with another branch
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment