Get only subdirectories with Git?

I'm trying to set up a version control system for our existing code, and I chose Git, but I'm brand new with that.

We have a server with a Git repository: MyProject. There are now several directories in this repository, each of which corresponds to a tool (which can be used independently of the others): MyProject / Tool1, MyProject / Tool2, MyProject / Tool3, etc.

Is it possible for the contributor not to pull the entire project to their local machine, but only from the directory (like Tool1), work on it and modify it, and then push to the server?

How can this be achieved?

Thank.

+3


source to share


1 answer


You can save projects Tool1, Tool2, etc. in separate git repositories so that they can be checked out, modified, and pushed independently.



The top-level MyProject repository can be another separate git repository and you can use git submodule add

to add Tool subdirectories as git submodules. This way you can pull out the entire MyProject repository, including the independent submodules.

+2


source







All Articles