Skip to content

Instantly share code, notes, and snippets.

@Mike1stver
Forked from ummahusla/git-overwrite-branch.sh
Created April 18, 2020 01:27
Show Gist options
  • Save Mike1stver/8d427c13592043163f5bb7f8788b7a2b to your computer and use it in GitHub Desktop.
Save Mike1stver/8d427c13592043163f5bb7f8788b7a2b 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