Reputation: 1983
I have two directories, each their own git repo, that I have realized are two parts/versions of the same project. I'd like to add them as sub-directories to a new project folder, while preserving the commit history of each.
Ideally, project_A and project_B would be branches of the same parent git repository.
Existing file structure:
project_A
| --.git
| --project_B files
project_B
| --.git
| --project_B files
Taraget File Structure:
ParentProjectFolder
|--project_A
| | --project_A files
|--project_B
| | --project_B files
Can this be done?
Upvotes: 0
Views: 34
Reputation: 2253
for you situation, try to use git submodules
in your ParentProjectFolder,
git submodule add your_remote_repo_url
check the doc http://git-scm.com/book/en/v2/Git-Tools-Submodules
Upvotes: 0
Reputation: 175017
git branch -u
git pull
into the target branch.You may have to resolve conflicts and perform a merge, depending on what changes there are on either repository.
Upvotes: 1