Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One project, Multiple customers with git?

Tags:

git

github

django

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.

like image 861
jujule Avatar asked Sep 16 '09 00:09

jujule


People also ask

How does Git work with multiple people?

Multiple people can work on the same branch at the same time. When you pull (or have the other person push) their changes to you git will merge the changes together resulting in a branch with both of your changes.

Can multiple developers checkout in Git?

Git allows multiple developers to work on the same code simultaneously. Sometimes, a programmer will need to access a coworker's independent work, or “branch.” The git checkout remote branch action makes this possible.

Can a Git repository have multiple projects?

Yes. You can put multiple projects in one Git repository but they would need to be on different branches within that repo.

How many branches should a Git project have?

There are five different branch types in total: Main.


1 Answers

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.

like image 110
Matthew Talbert Avatar answered Sep 16 '22 14:09

Matthew Talbert