一个项目,多个客户用git? [英] One project, Multiple customers with git?

查看:103
本文介绍了一个项目,多个客户用git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个单独的webapp,我用于不同的客户(django + javascript)



我打算使用GIT来处理这些不同的客户版本作为分支。每个客户都可以拥有自定义文件,文件夹和设置,改进版本,但应该共享相同的核心。我们是一个小团队,并且提供了一个github帐户。



分支是处理这种情况的好方法吗?



关于设置文件,你将如何进行?您会.gitignore客户特定的设置文件,并添加一个settings.xml.sample文件,例如是repo?



此外,是否有任何方法来防止某些文件合并为主人? (但提交给客户分部)。例如,id喜欢将一些客户数据保存到客户分支,但是阻止被提交到master。



.gitignore文件是否分支? YES



编辑
阅读所有答案后(谢谢!)我决定先重构我的django项目结构来隔离一个应用程序子文件夹中的核心和我的不同的应用程序。这样做会使一个更干净的项目,并调整.gitignore文件,使用git分支来轻松管理不同的客户和设置!



Ju。

解决方案

除了cpharmston的答案,听起来你需要做一些重构来分离每个客户端真正的定制,什么不是。然后,您可以考虑添加其他存储库来跟踪每个客户端的定制(全新的备份,而不是分支)。然后,您的部署可以从您的主要回购中提取您的核心,并从该回购中获取客户特定的内容。


Im new to GIT and dont know yet how much it will fit my needs, but it looks impressive.

I have a single webapp that i use for differents customers (django+javascript)

I plan to use GIT to handle these differents customers version as branches. Each customer can have custom files, folders and settings, improved versions... but the should share the same 'core'. We are a small team and suscribed a github account.

Is the branch the good way to handle this case ?

About the settings file, how would you proceed ? Would you .gitignore the customer specific settings file and add a settings.xml.sample file for example is the repo ?

Also, is there any way to prevent some files to be merged into master ? (but commited to the customer branch). For example, id like to save some customer data to the customer branch but prevent from to being commited to master.

Is the .gitignore file branch-specific ? YES

EDIT After reading all your answers (thanks!) i decided to first refactor my django project structure to isolate the core and my differents apps in an apps subfolder. Doing this makes a cleaner project, and tweaking the .gitignore file makes it easy to use git branches to manage the differents customers and settings !

Ju.

解决方案

In addition to cpharmston's answer, it sounds like you need to do some refactoring to separate out what is truly custom for each client and what isn't. Then you may consider adding additional repositories to track the customizations for each client (entirely new repos, not branches). Then your deployment can pull your "core" from your main repo, and the client-specific stuff from that repo.

这篇关于一个项目,多个客户用git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆