且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一个项目,多个客户用git?

更新时间:2023-08-24 16:40:28

除了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.