Skip to content

Instantly share code, notes, and snippets.

View ArnabXD's full-sized avatar
:octocat:
rethinking

Arnab Paryali ArnabXD

:octocat:
rethinking
View GitHub Profile
@ArnabXD
ArnabXD / git.sh
Last active August 2, 2021 07:03 — forked from simon04/git.sh
Git merge/replace orphan branch into main
git checkout --orphan new
# completely rewrite your application in new framework
git merge --strategy=ours --allow-unrelated-histories main
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new'" "HEAD^{tree}"
git reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout main
git merge --ff-only new