开发者

Git Best Practice for adding a common feature to different repositories

I have multiple clients each with their own unique codebase, each as a separate Git repository. I am developing a feature (a user manager) that I'd like to be able to add to each client repo. Since the user manager is continually being improved, I'd like to have it as a remote repo in each client where I could just issue a git pull to update that user manager feature without touching the other code.

The user manager repo is completely independent of other code on the client's codebases. There will be no overlap of files. Is it possible to have 2 different repos in one Gi开发者_运维知识库t setup?

So my questions are, is this the best way to go about adding a new feature to multiple sites using Git, and is it possible to have 2 remote repos in one git folder?


I think what you're looking for is called a Git Submodule

Here's even a better explanation (in plain english).


True, a Git Submodule is designed for that, but it'll be hard to manage eventually.

The best approach is ready made solutions:

Gitslave

http://gitslave.sourceforge.net/

Gitslave is a wrapper around Git that multiplexes git commits into multiple repositories. It effectively implements the “have parallel branches for each of your projects” solution to the merging problem by doing that for you – if you create a branch, it gets created everywhere. If you commit, all of your repositories create a commit, and so on.

-- from above url.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜