Suppose I have this folder structure:
/projectroot/foo/bar/subfoo/foo.txt
Now I change something in foo.txt
a make a commit.
I have another repository with the exact same foo.txt
but the folder structure is like this:
/projectroot/somedir/foo.txt
It's obvious that there should be a way to automatically apply the work on foo.txt
in the second repository. I guess one can create a patch but I fail to find the right way to do it. I somehow need to create a patch out of the commit that works only on the file (or relative to the parent directory) and then apply it only to the file or to the directory that hosts the file.
How can I do this with git?