I started a project some months ago and stored everything within a main directory. In my main directory \"Project\" there are several subdirectories containing different thi
Checkout git filter-branch.
The Examples section of the man page shows how to extract a sub-directory into it's own project while keeping all of it's history and discarding history of other files/directories (just what you're looking for).
To rewrite the repository to look as if
foodir/had been its project root, and discard all other history:git filter-branch --subdirectory-filter foodir -- --allThus you can, e.g., turn a library subdirectory into a repository of its own.
Note the--that separatesfilter-branchoptions from revision options, and the--allto rewrite all branches and tags.