Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

We have a family of apps, all having the same base. Until now I've been developing this base, and the Git workflow was very simple:

  • Development is done in develop branch
  • New features are developed in name-of-the-feature branch
  • Releases are made in release-** branch

Until now, the code was the same for every app of the family. Let's say the base they share is now complete, and from now on the code will be different for every app.

I'm not sure how should I deal with git and this multiple apps that have the same base.

  • Should each one of them have its own git project?
  • Should they be on the same project, but each one in its own branch?

The point is: if I put them on separate projects, every modification done in the base of the app will have to me repeated in each of the apps. I'm not very familiar with git, but if I store each project in a branch, will be possible to merge the base modification with each app?

Does anyone have experienced a situation like this? I'm not sure how to proceed.

Thanks!

EDITED When I said version I didn't mean like version numbers. They are actually different apps that share the same base.

share|improve this question

2 Answers 2

If the apps won't modify the base itself, consider leaving the base in its own repository. Then create a new repository for each of the indiviudal apps and add the base as a git submodule.

share|improve this answer

Leave the base app in it's own repository, and create new projects that depend on the jar you compile from that repository.

Git branches are not for multiple apps. Git prefers that you use one repository for each project or a related family of projects. Branches are there so that you can develop features in isolation, not so you can create entirely new project without leaving the repository.

You don't want to have multiple apps that share code - that's a maintenance nightmare. If as you suggest you develop each as a branch in your central repo, you will have a lot of merging going on to propagate the changes to each app. It's much easier to depend on a single, separate library and use something like Apache Maven to pull in project dependencies.

share|improve this answer
    
Much of the code that is shared is GWT code (views, services, etc). Is it possible to extract it to a jar library? Or it's just possible to server-side java code? –  João Daniel Feb 13 '12 at 12:58
    
View elements can be extracted, but possibly not to a jar. For instance, javascript can be extracted from every page into a single file that can then be included in each project. JSP common code should be extracted into JSP tags. You probably don't need to pull entire pages, but I don't know your project, so I could be wrong. –  Michael K Feb 13 '12 at 13:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.