arrow_back Back to Notebook
git
git
January 10, 2019

How to merge a branch in git with an unrelated history

You can merge a branch with a different history by adding the flag --allow-unrelated-histories

--allow-unrelated-histories example

git merge master --allow-unrelated-histories

Thanks for reading!

John Wiseman

Full-Stack Software Engineer building scalable digital solutions. specializing in modern web technologies and mission-critical systems.

© 2026 Wiseman Systems Pty. Ltd.

Navigation

Start a Conversation

Ready to discuss your next project? Let's build something extraordinary together.

Get in Touch