Git submodule or sub-repository or remote?

允我心安 提交于 2019-11-30 03:00:50
John Douthat

The layout you've described will work really well with git submodules. I'd gently recommend reading the docs and trying a few tutorials. The key difference your plan introduces is that each client repository and client plugin repository will have two remotes instead of one. And, when you want to start a new client project you will need to

  1. fork the mainline cms
  2. fork all of the plugins that will be modified
  3. clone the forked cms from (1), update its submodules to point to the new remotes from (2)
  4. initialize/update the submodules
  5. (optional) add the mainline cms URL as a remote in your client's forked cms
  6. (optional) add the mainline plugin URLs as remotes in your client's forked plugins

A better option may be to use the same repository and simply make a branch per client. That is how I would do it.

Maxime Brehin

Short update / additional information about the previous answer: if you don't like git submodules approach or think this is too hard to understand, you can try

Don't forget to check if you can use another depency manager (like RubyGems for Ruby, Composer for PHP...) instead of submodules, it would be easier to use and maintain.

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