I have some files that exist in a directory in Repo 1. Let's say its a video playback feature. All the file relevant to this feature were not created in this directory. Sometimes developers will realize that commonality and move all the files into a common location.
Now we have a core library where we want all these files to live so they can be reused by other projects. I have successfully used the following commands to get the files into the other repository but it is missing the history of the files before they were moved in Repo 1 to a common directory.
How can I go about doing this such that the file's entire history would be included in the core library regardless of how many times it was git mv'd in Repo 1?
cp -R repo-where-feature-exists/ video-filtered-repo
cd video-filtered-branch
git remote rm origin
git filter-branch --subdirectory-filter src/main/resources/static/video-poc/js/video/ -- --all
rm -rf src/
mkdir -p component-library/src/main/resources/components/video
git mv -k * component-library/src/main/resources/components/video/
git commit -m "Moving files from where they were in the original location into the core location"
Now go to core…
cd /software/dp/core
git remote add video-feature /software/dp/video-filtered-repo/
git pull video-feature integration