The git repository for an existing open source library looks something like this:A/              B/              C/D/              E.txt           F.txtI need to create a new repository for a new library, beginning with a copy of a subset of this code. For example, I might want my repository to contain:A/              B/              E.txtThat is, I want the new repo to contain the A and B directories (with their contents) and E.txt unchanged. The new library has no need for C, D or F.txt.I can see two ways to do this:git clone the existing repository, then git rm C, D and F.txt.git init a new repository, then git add the latest versions of A, B and E.txt.The problem with the first approach is that there will be significant history in the repository for the items which have been removed. This history is irrelevant for the new library. OTOH, the second approach leads to a repository with no history at all!Which of these approaches is preferable?Might it be better to create my new repository that contains only the relevant files and only the history for those files? Can this be done (perhaps with git filter-branch)? Would this indeed be better than either of the above approaches?
Create a new git repository which includes part of an existing one?
derivative works;forking