2

Pretty early on I made a directory (we'll call this "parent directory") a git repo and started storing all of my school projects in their own subdirectories. Each subdirectory contains its own unique and separate project. I realize now this was a mistake and I need each subdirectory to be its own individual repository, while also keeping intact the commit history for each subdirectory. I also need to undo the repo on the parent directory. Is there any way to do this?

2

1 Answer 1

2

GitHub has a pretty handy guide, with specific instructions for a variety of operating systems: https://docs.github.com/en/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository

The core of those instructions, for every OS, is to use git-filter-repo to split the original repo by path. After that, for each new repo, it's just a matter of setting up one or more remote paths; setting up space on your remote; and pushing the new repo to the remote.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.