![]() ![]() License: Creative Commons BY-SA GitFlow pros and cons The main and develop branches are considered to be the main branches, with an infinite lifetime, while the rest are supporting branches that are meant to aid parallel development among developers, usually short-lived. Hotfix- also helps prepare for a release but unlike release branches, hotfix branches arise from a bug that has been discovered and must be resolved it enables developers to keep working on their own changes on the develop branch while the bug is being fixed.Release- help prepare a new production release usually branched from the develop branch and must be merged back to both develop and master.Feature- to develop new features that branches off the develop branch.This branching strategy consists of the following branches: The images below illustrate this concept, where the top image shows the master branch and a pointer pointing to the last commit and the image right below it shows what happens when you create a new branch called ‘dev’- a new pointer now points to the latest commit.Ĭonsidered to be a bit complicated and advanced for many of today’s projects, GitFlow enables parallel development where developers can work separately from the master branch on features where a feature branch is created from the master branch.Īfterwards, when changes are complete, the developer merges these changes back to the master branch for release. Git branches, then, can be seen as a pointer to a snapshot of your changes. As you create new commits in the new branch, Git creates new pointers to track the changes. In Git, a branch is essentially a reference or a pointer to the latest commit in a given context it’s not a container for commits. Meanwhile, other VCS tools store information as a list of file-based changes which may slow things down and use up significant space. ![]() This means that these branches aren’t just copies of the file system but simply a pointer to the latest commit. The biggest advantage of a Git branch is that it’s ‘lightweight’, meaning that data consists of a series of snapshots so with every commit you make, Git takes a picture of what your files look like at that moment and stores a reference to that snapshot. The default branch in Git is the master branch. Git branches allow developers to diverge from the main branch by creating separate branches to isolate code changes. Put simply, Git and other version control tools allow developers to track, manage and organize their code. However, in this article we focus on Git due to the many advantages this model of branching offers.Ĭonsequently, before we delve into the various branching strategies out there, including Git branching strategies, we will take a look at how Git actually handles branches and why it’s a standout among other VCS tools.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |