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?
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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With