Reputation: 8413
I have a git repository in folder AAA and then another git repository in folder BBB.
What I need to do is to create a new folder in AAA where I would copy BBB repository, so it would become a subfolder of AAA.
The result should be that AAA repository stays as it is and excludes BBB folder, while when I enter the BBB folder it's a new repository of its own that has nothing to do with AAA.
Could you please explain me how to do that?
As I understand, I probably could create subfolder BBB in AAA then add it to .gitignore and then initialize a new repo there? Right? How would I do that? Thank you!
Upvotes: 1
Views: 414
Reputation: 44377
This is the absolute minimum that you would need to do
git init AAA
cd AAA
echo BBB > .gitignore
git init BBB
For most scenarios submodules is a better solution. But if you want the repositories to be completely independent of each other, this is a way to do it.
Upvotes: 3