Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git - project evolution, branch or new repo?

I have developed a Google App Engine web application versioned on GitHub.
I'm going to "port" this application making it GAE agnostic; this port would have several files in commons with the original project but also a different file system structure.

Is it better to create a new branch (nogae) and work on it or is it preferable to create a new git repo (project.nogae)?

What's the pros and cons?

like image 329
systempuntoout Avatar asked Oct 23 '10 12:10

systempuntoout


People also ask

When should I start a new repository?

A new repo should only be created for a new project. For instance, if you are working on a 2 different e-commerce sites, don't put them in the same repo unless they have to work together.

Is it better to fork or branch?

A branch-centric workflow makes sense for most business settings. Forks can be a really good pattern for 'public' collaboration and experimentation, but when the intended use case is many people working toward a unified goal, branching tends to be a better fit.

What is the difference between repository and branch in git?

A repository is your whole project (directories and files) that you clone on your computer. A branch is a version of your repository, or in other words, an independent line of development. A repository can contain multiple branches, which means there are multiple versions of the repository.

What's the difference between branching and forking?

Branching is to create another line of development in the project without affecting the main branch or repository. Forking, on the other hand, is to make a clone of the repository on your GitHub account without affecting the main repository.


1 Answers

Arguments for two branches

Creating a new branch is interesting if the two versions are tightly linked together (some evolutions on one are likely to be reported on the other):
If the files are the same in both branches (even if their names/paths are different), a branch is a good choice.

Arguments for two projects

But if the two projects will evolves independently, with few common files, then two separate projects are better.
If the common set of files is important enough, then a third project might be created and imported in the first two ones as a submodule.

like image 141
VonC Avatar answered Sep 22 '22 08:09

VonC