Same project, multiple git clients workflow

After my first question, the identifier would like to receive confirmation of the git workflow in my case.

I have one django project hosted on github, and different clones with each of its own branch: customerA, customerB, demo ... (think sites)

Branches have the same core, but have different data and settings (they are in gitignore)

When I work in the CustomerA branch, how do I replicate some bug fixes to other deployment options?

When I create a new generic function, I create a special branch and then merge it into my master. Then, to expand on the "clients", I merge the main branch into the client branch. Is it correct? or should i reinstall?

# from customerA branch git fetch origin master git merge origin master 

In addition, I created a remote branch for each client so that I can back up client branches in github.

This seems like a very classic problem, but I think I am not using git the right way

Thanks.

Ju.

+4
source share
4 answers

I would have one project repo in a known place containing the main branch with common code, and branches for specific deployments (for example, client / client / B-demo).

Then I would have checks from each of these branches for each client, for the demo server, and so on. You can let these automatically pull them out of your branch by committing to the same project repository.

Each developer will have their own local copy of the project repo, do local work and then redirect the data back to the repository of one project.

The challenge will be to maintain branches that diverge from the host and perform regular merges, so the deviation does not increase over time.

I saw that this solution describes somewhere in much more detail somewhere on the Internet, but I could not find it quickly. Some blog posts about using git for the intermediate and production web server, IIRC.

+2
source

If the three sites use some β€œcore” code (for example, a Django application), you should include this kernel in your own repo and use git submodules to include it in other projects, and not duplicate it.

+1
source

I would have a repo called a project wizard or something like that, and a repo for each client. Then, when you have the code, you need to be available for these client repositories, you go from the project wizard to this repo.

0
source

Do not separate projects in branches, do not separate them into different repositories.

Make the generic code generic enough so that the costumerA copy of the generic code is exactly the same as the costumerB copy of the generic code.

Then you do not need to pull or merge anything. When you update shared code, both costumerA and costumerB will automatically receive the update (because they use the same common code).

By "common" code: I mean a package / series of applications that support the websites you are developing.

I assume that costumerA and costumerB repositories will only include options such as settings and site templates.

The key here is to create a generic "generic" code: don't let costumerA use the "slightly modified version" of the "generic" code.

Also, I would suggest using a deployment mechanism that does not rely on git. git is a great source code management tool; but it is not designed (AFAIK) as a deployment tool.

0
source

All Articles