How to merge two git repositories into one? I have got a parent folder say 'P' and two subfolders 'A' which has 5 commits and 'B' which has 5 commits. I want the repos in A and B to disappear and combine as one with 10 commits,this new repository must be placed in the parent directory 'P'.
Asked
Active
Viewed 220 times
1 Answers
1
The basic idea is to merge two repositories are as follows
Create a new empty repository New. Make an initial commit because we need one before we do a merge. Add a remote to old repository old A. Merge old A/master to New/master. Make a sub directory old A. Move all files into sub directory old A. Commit all of the file moves. Repeat 3-6 for old B.

Bharat Sahu
- 13
- 2