I've a repository which contains several directories at the root, e.g.
gitroot/a
gitroot/b
gitroot/c
And I would like to create a new git repository from only the contents of a, whilst retaining its history. Is this possible? I've seen the sparse checkouts, but I'm not sure how I could use this to create a brand new repository (with relevant history) from a subdirectory.
After cloning your existing repository, you can use filter-branch
After that;