Why do we need branches in git?
Is it possible to do without them?
How can I use them?
1 - Classic Turnip Model:
master is the latest stable release; dev is the current development branch;
dev-xxx is a branch of development associated with a planned future release.
2 - Classic work in team turnips:
merged updates - budded branch - you work in it - completed it - again merged updates into the original branch - merged branches - launched into a common turnip.
3 - T. n. git-flow - each bugfix and feature are made up in a separate branch, after the end of the work there is a merge with the dev-branch, otherwise the work is as in step 1, plus or minus the subtleties of budding hotfixes and their mergees. Link times , link two .
With the help of branches in VCS you can:
In the case of git, distributed work itself is inextricably linked with the concept of local and remote branches and the synchronization of commits between them.
A branch in Git is simply a “sliding” pointer to one of the commits. When you create new commits, the branch pointer automatically shifts forward to the newly created commit.
To work with Git on the simplest project with one developer, one branch is enough, but on larger projects more than one branch is used. There are various branches management strategies, such as git-flow .
In principle, you can do without branches, creating all commits manually, after which they will be stored as lost objects. But this is an unnecessarily complex way. In addition, the garbage collector will delete them sooner or later.
Source: https://ru.stackoverflow.com/questions/359844/
All Articles
git branch newbranchin the console!" (speaking in Russian - I plod when I create a new branch). And a similar question might be "why the letter" d "in Russian, tell us more about situations where you can not do without it" (I wonder if you’ll ask such a question on EYE, they will give you an answer or they will seriously answer). - zb '12