0

I have a base website project which I use as a starting point for several customers. Each customer can have specific changes to the project which I don't want to include in the base project. However sometimes a specific customer feature makes sense to include in the base project and push to all other customers ( such as bug fixes ).

Right now I have the projects setup with TFS, so that each customer is a branch of the base project. It works by merging changes to the base into each branch, but it is a terribly slow process. I would like to switch to git (on github), so I can perform these operations locally and reduce the time spent on these operations.

After reading tons of articles, these are my conclusions so far :

  • Git branching will not work well in my scenario. I need different folders for each project, so I can run the sites simultaneously.
  • "Submoduling" the base code into each customer repo does not seem like the right solution, as the base is not a subfolder in the project, it "is the project".
  • Cherrypicking changesets requires the base remote to be added to the customer project and seems complicated ( and I haven´t been able to make it work so far )

So as far as I understand, I should create a new repo for each new customer, copy the code from base initially, and create patches for moving changes between the projects (i am not concerned about history). I can probably live with this approach, expecially if I can create a tool which automates the process.

Could someone please tell me if I'm on the right track, and how I should go about adding new sites ideally ( having in mind that the workflow should work for several developers).

Thanks in advance

jbc
  • 149
  • 1
  • 3

1 Answers1

0

I don't see any reason that branches wouldn't work for that. You should be able to have the common commits on a base branch, and create a branch off of that for each customer; whenever there are updates to the base branch they would be merged into the different customer branches. Just as you are currently doing with TFS.

If you are going to be serving directly out of a git working tree, you would need to have a separate copy of the repository for each site being served to allow you to have a different branch checked out in each. But, you could still have all of the branches contained within a single repository on Github.

Another option would be to use a single repository and working tree locally outside of the area handled by the web server and then use a deployment process to copy the data to be served into the appropriate location. Since the web server wouldn't be looking directly into a git working tree, you wouldn't necessarily need to have multiple branches checked out at the same time.

qqx
  • 18,947
  • 4
  • 64
  • 68
  • The middle section of your answer looks interesting. However, if I only have one repository, then all the branches will exist in that repository which could become quite difficult to maintain. Imagine that each customer has it´s own lifecycle with deployment / hotfix / development branches. I guess what I really would like to do (conceptually ) was to fork the main project for each customer, but apparently that is not possible. – jbc Aug 18 '13 at 18:03
  • Hmm, I found this workaround http://bitdrift.com/post/4534738938/fork-your-own-project-on-github for forking your own projects. I guess I will try it out. The only concern I have is if I will be able to pull only certain changes, and if I can push changes from a customer project to the base. – jbc Aug 18 '13 at 18:11