I inherited a git repo that has multiple projects in it. It’s easier to manage the code and dependencies if each of these projects are in their own git repo.
The process is pretty simple:
- Export the directory you plan to use as the starting point of the new repo
- Create the new repo
- Import the old repo
- Export the directory
git log --pretty=email --patch-with-stat --reverse --full-index --binary DIRECTORY > /tmp/DIRECTORY_patch;
2. Create the new repo
git init REPONAME;
3. Import the old
cd REPONAME; git am < /tmp/DIRECTORY_patch;
Run ‘git log’ to verify that you’ve successfully import the repo.