andorx
7/14/2016 - 11:07 AM

Git push a sub-directory into other main repository

Git push a sub-directory into other main repository

git clone <ORIG_REPO_DIR> <NEW_REPO_DIR>
cd <NEW_REPO_DIR>
git filter-branch --prune-empty --subdirectory-filter <THE_SUBDIR_TO_MAKE_NEW_ROOTDIR> master
git push <MY_NEW_REMOTE_ORIGIN_URL> -f .