Skip to content

Instantly share code, notes, and snippets.

@awwong1
Created April 7, 2018 05:27
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 awwong1/32a6abb8293b32b799b8bcdbd120aaa1 to your computer and use it in GitHub Desktop.
Save awwong1/32a6abb8293b32b799b8bcdbd120aaa1 to your computer and use it in GitHub Desktop.
force add separate repo as subfolder in current repo
cd path/to/project-b
git remote add project-a path/to/project-a
git fetch project-a
git merge -s ours --allow-unrelated-histories project-a/master
git read-tree --prefix=project-a/ -u project-a/master
git commit -m "Merge project-a"
git remote remove project-a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment