I want to create a new git repository of a folder under an existing git repository. I want the history to be preserved in the new repository. How do I create this new git repository?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can clone it, and then apply on the clone a filter-branch in order to split that repository, extracting only the directory you want (with its full history).
See Detach subdirectory into separate Git repository
Note the
git clone --no-hardlinks /XYZ /ABCused during the cloning step: