1

I have a folder structure like this, with all folders and files within one git repository:

├── folder-01
│   └── script.sh
├── folder-02
│   └── script.sh
├── folder-03
│   └── script.sh
├── folder-04
│   └── script.sh
└── .git

is it possible to extract the folders from the main repository into separate repositories, each within one folder, so it would look like this:

├── folder-01
│   ├── .git
│   └── script.sh
├── folder-02
│   ├── .git
│   └── script.sh
├── folder-03
│   ├── .git
│   └── script.sh
└── folder-04
    ├── .git
    └── script.sh

I would be also interested in the command for doing it manually one by one.

  • 1
    Read about git submodules; this is what I believe you want. – Aaron D. Marasco Aug 8 '19 at 23:51
  • @AaronD.Marasco thanks for the hint, it looks like git filter-branch is doing what I want though I did not find a batch solution doing it for all subfolders... – nath Aug 10 '19 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.