Skip to content

Instantly share code, notes, and snippets.

@equinusocio
Forked from simon04/git.sh
Created October 19, 2020 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save equinusocio/807e59eff33e0dd401acf94346d7bccb to your computer and use it in GitHub Desktop.
Save equinusocio/807e59eff33e0dd401acf94346d7bccb to your computer and use it in GitHub Desktop.
Git merge/replace orphan branch into master
git checkout --orphan new-framework
# completely rewrite your application in new framework
git merge --strategy=ours --allow-unrelated-histories master
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new-framework'" "HEAD^{tree}"
git reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout master
git merge --ff-only new-framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment