My code depends on files provided by an existing repository. As each file requires some work, I want to bring the files in as they become supported, rather than just adding all files at once. I would also like to track from and commit changes to upstream for the imported files.
After some reading git subtree split seems promising and I followed the directions in
Git Subtree only one file or directory
with some modifications
git remote add project _URL_
git fetch project
then
git branch project_master project/master
git checkout project_master
then
git subtree split --squash --prefix=path_of_interest_in_project -b temp_branch
then
git checkout master
git subtree merge --prefix=directory_destination_path temp_branch
What happens is that git subtree merge seems to ignore the prefix flag and checks out the content of path_of_interest_in_project in the projects root folder. No squashing seems to be performed as the whole history of project/master is imported.
Is this the correct behavior or a bug in Git? Are there better solutions to achieve what I want?