git-filter-repo icon indicating copy to clipboard operation
git-filter-repo copied to clipboard

[Question] Lost all folders

Open BenGeba opened this issue 1 year ago • 1 comments

I want to move a subfolder from an existing repository to a new repository.

The folder structure looks like this:

src/
  client/
  common/
  server/
    web/
      project1
      project2

If I now want to extract project 2, I have used the following command:

git filter-repo --subdirectory-filter Server/Web/Amagno.Server.Web.DocumentRecognition/

The history is still there, but when the script cleans up, everything is simply thrown away and only the .git folder is left in the main directory.

I would have thought that it would now look like this:

src/
  project2

Have I misunderstood something fundamental or am I doing something wrong?

BenGeba avatar Aug 14 '24 13:08 BenGeba

You haven't stated what the repository structure of the original repository was. I suspect that Server/Web/Amagno.Server.Web.DocumentRecognition/ was not a directory tracked within git; perhaps you gave a path relative to your current working directory, and you weren't in the toplevel directory of the repository? What is the output of git ls-tree -rlt HEAD | grep ' tree ' in your repository before doing the cloning?

newren avatar Aug 23 '24 23:08 newren

No response, so I'll close.

newren avatar Nov 28 '24 06:11 newren