简体   繁体   中英

Get only sub-directories with Git?

I am trying to set up a version control system of our existing code and I chose Git but I am quite new with this.

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

Is it possible for a contributor to not pull the whole project on his local machine but just on directory (for exemple Tool1 ), work on it and modify it and then push it on the server?

How can this be achieved?

Thank you.

You can keep your Tool1 , Tool2 , etc., projects in separate git repositories to allow them to be pulled, modified, and pushed independently.

Your top level MyProject repository can then be yet another separate git repository and you can use git submodule add to add the Tool subdirectories as git submodules. This way you can pull the entire MyProject repository including the independent submodules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM