|
|
Using Git Branches
|
|
|
--------------------
|
|
|
|
|
|
Git branches are a good way to handle contributions of several developers, where some are working on new, maybe somewhat experimental parts of the content, while the established part of the content is protected from being ``messed up'' by premature or erroneous contributions.
|
|
|
|
|
|
By default, every repository has at least one branch, which is called Master. If no other branch exists, any commits and pushes always alter the Master branch, while Git remembers the complete version history of this branch.
|
|
|
|
|
|
If a new branch is created, the version history bifurcates at this point and is being kept separately for Master and the new branch. Users can synchronize local clones with either of them (this process is called checkout) and can commit and push to one or the other (provided that they have permission to push to the Master branch -- the project owner can restrict the permission to that). At a later stage, if it turns out that the content of the new branch is useful, it can be re-included into the Master branch -- this is called Merging.
|
|
|
|
|
|
**Create a new branch**
|
|
|
|