1

Existing repository in my computer is like this.

Parent
  └ A/
  └ B/
  └ C/
  └ D/
  └ .git
  └ .gitignore

I want to pick two folders 'C' and 'D', and push it to new remote repository on github.

Existing repository can ignore 'C' and 'D', but I want to keep this folder hierarchy.

I searched 'submodule' or 'subtree', but they seem to work on just single subfolders, not two folders 'C', and 'D'.

Is there any solution?

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
Yoon Terry
  • 11
  • 1

1 Answers1

0

You could use git filter-repo tool: https://github.com/newren/git-filter-repo/

git filter-repo --path C/ --path D/
kosist
  • 2,868
  • 2
  • 17
  • 30