I want to pull from and push to only a subdirectory of a git repository. Here is an example of what I want to achieve:
Let's say, I have a repository, containing two folders A
and B
(they are top-level folders, if that matters). I want to work and push changes into B
only, while others are working on A
and maybe even on B
as well. Because I want to commit my changes back, I can't put A
in the .gitignore
file, nor I can use git rm -rf --cached A
, since A
is needed by others, however, I know, I will never touch any of the files it contains, and I simply don't want to store the unnecessary files of it. I can't use submodules
either, as I don't want to change the original repository, nor I want to maintain a secondary one.
So my questions are: is this even possible; and if so, how can achieve this?