How to manage a project dependent on another project in Git?

梦想的初衷 提交于 2019-12-12 14:35:22

问题


I apologize for the somewhat confusing question, I'm not sure how to explain it in short. Let me also apologize that I'm fairly new to Git and so I may be missing an obvious solution (thus why I ask).

So essentially, I have a three step project here that I'm trying to easily keep up to date:

  1. I'm developing in CakePHP, which is regularly updated.

  2. Using CakePHP, I am developing a system I've called "Mobile Fort," which is basically a fully developed user management system with a few other features.

  3. Using Mobile Fort, I'm developing several different individual websites.

The question is, how do I (if possible) use Git to keep my CakePHP install up to date (CakePHP is developed in Git) to Mobile Fort, and keep my Mobile Fort install up to date across the various individual projects?

Thank you so much!


回答1:


I think what you need is git submodules. Basically it allows you to have a subrepo within a repo, while keeping them distinct from each other. Read the doc to learn more.




回答2:


Based on Simon and Tempus's response I did more research, and found a great article on using CakePHP as a submodule to accomplish this exact purpose. Hopefully this will be useful for other's using CakePHP and Git:

http://www.bravo-kernel.com/2010/03/cakephp-as-a-git-submodule/

This was the harder portion, since it seems counterintuitive to make CakePHP a submodule. The rest can be done using submodules as they were intended.

Thanks to Simon and Tempus!



来源:https://stackoverflow.com/questions/8001996/how-to-manage-a-project-dependent-on-another-project-in-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!