I want to copy the contents of a git repository to another repository inside a folder.
SourceRepo/ -A -B
TargetRepo -C -D folder/
i want to move (A,B) inside folder/ with branch and commit history.
Please help.
I want to copy the contents of a git repository to another repository inside a folder.
SourceRepo/ -A -B
TargetRepo -C -D folder/
i want to move (A,B) inside folder/ with branch and commit history.
Please help.
The git subtree command does exactly what you want. Execute the following command on TargetRepo in the branch you want to add it to:
git subtree add --prefix=folder <git-url-of-SourceRepo> master
This will add SourceRepo's master branch inside folder in your TargetRepo.