I have a directory structure in my repository:
|-repository/
| | |-repository/fileOne
| |
| |-subOne/
| | |-subOne/fileTwo
| |
| |-subTwo/
| |-subTwo/fileThree
I want to move the directory subOneto another repository. For this, I split subOneusing git-filter-branchas follows:
$ git filter-branch --subdirectory-filter subOne --prune-empty
This leaves me with a branch history that looks like this:
$ git log --oneline
0c0ea11 subOne history
6318bba subOne history
c96fddb Initial commit
This is exactly what I want; from another repository I can do git fetchand git merge, which adds subOnehistory to another repository. It's great.
However git-filter-branchdeleted subOne. Checking the directory structure on my branch:
$ ls
fileOne
$ pwd
/this/is/a/path/repository
pwd should read: /this/is/a/path/repositorybut lsshould show subOneinside the repository. Instead, I have files subOnemoved up, and the directory is deleted.
subOne ?