I have a git
repository of an application with multiple branches. The source tree consists of several directories. E.g:
main_folder
|--> .git
|--> dir0
|--> dir1
|--> dir2
Unfortunately, from the beginning of the development I didn't use git-submodules
nor git-subtree
. Now I want to move one of the directories, e.g dir0
to a new repository as a new stand-alone application, Of course if possible, I want to keep both history and branches of the corresponding directory.
So I have two questions:
- The first and obvious one is how I can do this?
- Also for the old repository, what would be the best practice? Just delete the folder and commit the changes, or something else?