Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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.
share|improve this answer
    
Thank you, I didn't thought of doing it this way! – user36354 May 6 '10 at 20:08
    
@user36354 You may want to consider "4. Run git filter-branch in order to pretend the files have always been in folder C." But this is a bit advanced and not really necessary (e.g. git blame can follow the history to the original location). – maaartinus Jun 10 '12 at 10:50

http://stackoverflow.com/questions/614229/can-i-move-the-git-directory-for-a-repo-to-its-parent-directory/614254

share|improve this answer
2  
That question is different - they are discussing how to combine two git repos into one. – Kevin Panko Jul 27 '10 at 15:03

You must log in to answer this question.