简体   繁体   中英

How to properly commit a git repo with repos in subdirectories?

I have cloned few github repositories under one directory. Now I would like to make a repository one level above all of those repositories.

How can I do this properly ? Should I use submodules ?

Short answer: yes, you should use submodules because you've identified that these pieces should evolve separately.

Probably the easiest way to get it all in place is to create an empty folder, copy the "one directory up" content (anything not in the submodules) into it, commit, then pull in the submodules. This is because it's really easy to accidentally commit the submodule's code rather than referencing the submodule.

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