Repository A)
MAIN
../repository_A/
../repository_A/some_directory/some_files
Repository B)
MAIN
../repository_B/
../repository_B/SRC/some_directory/some_files
The repository_B structure is identical to the repository_A structure, except for the /SRC/ directory which is in place because the main directory of repository_B has a .gitmodules
file.
The ultimate goal is to clone/merge the content of /repository_B/SRC/
directory into /repository_A/
root - the folder structure is identical, so we need to write into existing folders of repository_A - for example write content of repository_B/SRC/includes
directory into repository_A/includes
.
Behind the task is that i have a modular system which is repository_A that is extended through modules which are represented by repository_B.
Another option that would do the job too would be to mv
repository_A
into another directory so that the folder structure is identical to repository_B
.
You won't need to git clone, but you will need a git merge.
If you want to merge repository B into repository A:
cd path/to/repo-A git remote add repo-a path/to/repo-B git fetch repo-B git merge repo-B/master # or whichever branch you want to merge git remote remove repo-B
Reference: How do you merge two Git repositories?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.