Created
September 4, 2019 07:31
-
-
Save vovateleport/252337d9b9627a9838f821ca3b7b8567 to your computer and use it in GitHub Desktop.
How to merge git repos into one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir projTotal | |
cd projTotal | |
git init | |
git commit --allow-empty -m "Initial commit" | |
#add any number of projects | |
git remote add -f proj [email protected] | |
git merge --allow-unrelated-histories proj/master | |
mkdir subProj | |
ls -a -1 > proj.files | |
vim proj.files | |
#remove manually subProj, proj.files, .git, ., .. | |
for f in $(cat proj.files); do git mv $f subProj; done | |
rm proj.files | |
git commit -a -m "Move proj files to subdir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment