Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Lost all folders #593

Open
BenGeba opened this issue Aug 14, 2024 · 1 comment
Open

[Question] Lost all folders #593

BenGeba opened this issue Aug 14, 2024 · 1 comment

Comments

@BenGeba
Copy link

BenGeba commented Aug 14, 2024

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?

@newren
Copy link
Owner

newren commented Aug 23, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants