Add a parent directory to a git repositoy

githistoryrepositoryversion control

I have created a git repository for the C implementation of a program.

I am about to add a Matlab implementation and I would like to have a single repository with two subdirectories: one for the C and one for matlab.

Of course, I would like to keep the full history too!

What should I do?

Best Answer

Do it in separate steps:

  1. Create two new folders: C and Matlab.
  2. Move existing files from the current location into the C folder.
  3. Start adding new files in the Matlab folder.
Related Question