Skip to content

Instantly share code, notes, and snippets.

@Regis011
Forked from ummahusla/git-overwrite-branch.sh
Created October 14, 2023 14:19
Show Gist options
  • Select an option

  • Save Regis011/d3db63d284f4f94f5b126b9aba3f0da5 to your computer and use it in GitHub Desktop.

Select an option

Save Regis011/d3db63d284f4f94f5b126b9aba3f0da5 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