I have a project, which consists of several separate Git repositories (merge several Maven projects each with a separate Git repository).
Now I want to create one Git repository and put the contents of each of those repositories into sub-directories of it, preserving their respective histories (merge several Maven projects into one multi-module Maven project).
How can I do that?
I tried to apply the answer to a similar SO question:
- Let's call individual repositories
P1
-PN
and the unified repositoryU
. - Create repository
U
. - Create branch
P1
inU
(git checkout -b P1
). - In
P1
directory, run the commandgit remote add U git@myuser.beanstalkapp.com:/U.git
. - In
P1
directory,git push U P1
.
When I do this, I get following error in the last step:
error: src refspec ccplogic does not match any.
error: failed to push some refs to 'git@myuser.beanstalkapp.com:/U.git'