Skip to content

Instantly share code, notes, and snippets.

@hakjoon
Last active February 15, 2017 22:33
Show Gist options
  • Save hakjoon/46d8b4a7c3c67e5ff611fc85172b793f to your computer and use it in GitHub Desktop.
Save hakjoon/46d8b4a7c3c67e5ff611fc85172b793f to your computer and use it in GitHub Desktop.
Merge repos maintaining history
# You will lose any untracked files so a new checkout is probably wise
git checkout --orphan <branch_name>
git rm -rf .
git pull <other repo>
# clean up file structure. For example remove packaging metadata files
git merge master
git checkout master
git merge <branch_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment