I have the following structure:
 my_main_project/
    my_lib/
       file1
       dir2/
           file2
    my_other_files
And now, the my_lib has got to the point where it really should be it's own library, and should be a submodule in my_main_project
IE:
my_main_project/  (is repo)
    <my_lib>  (is sub module)
    my_other_files/
my_lib/ (is repo)
    file1
    dir2/
    file2
I ideally wish to keep the git history for my_lib for obvious reasons.
Anyway, I tried the following: Convert a git folder to a submodule retrospectively?
However, it fielded this error
$ git filter-branch --subdirectory-filter '../my_main_project/my_lib' --prune-empty -- --all
> fatal '../my_main_project/my_lib' is outside repository
What, am I doing wrong and what needs to be done to get this working. I should point out that my_main_project is on branch master, and that is the branch of the subdir I wish to port.
Please let me know if there is an supplementary information you need.
 
     
    