Branching (version control)
Branching, in
Branches are also known as trees, streams or codelines. The originating branch is sometimes called the parent branch, the upstream branch (or simply upstream, especially if the branches are maintained by different organizations or individuals), or the backing stream.
Trunk
Child branches are branches that have a parent; a branch without a parent is referred to as the trunk or the mainline.[1] The trunk is also sometimes loosely referred to as HEAD, but properly head refers not to a branch, but to the most recent commit on a given branch, and both the trunk and each named branch has its own head. The trunk is usually meant to be the base of a project on which development progresses. If developers are working exclusively on the trunk, it always contains the latest cutting-edge version of the project, but therefore may also be the most unstable version. Another approach is to split a branch off the trunk, implement changes in that branch and merge the changes back into the trunk when the branch has proven to be stable and working. Depending on development mode and commit policy the trunk may contain the most stable or the least stable or something-in-between version. Other terms for trunk include baseline, mainline, and master, though in some cases these are used with similar but distinct senses – see version control § Common terminology. Often main developer work takes place in the trunk and stable versions are branched, and occasional bug-fixes are merged from branches to the trunk. When development of future versions is done in non-trunk branches, it is usually done for projects that do not change often, or where a change is expected to take a long time to develop until it will be ready for incorporating in the trunk.
Merging
Branching generally implies the ability to later
Motivations for branching
Branches allow for parts of software to be developed in parallel.
Development branch
A development branch or development tree of a piece of software is a version that is under
Often, the development branch is the
Shadow or magic branches
In CVSNT, a shadow or magic branch "shadows" changes made in the upstream branch, to make it easier to maintain small changes (cvc is an open-source package building system[citation needed] incorporating a revision-control system for packages produced by rPath.)
Distributed revision control
Repository clones
In
In some
See also
References
- ISBN 0-20174117-2. Retrieved 2007-05-24.
- ^ Appleton, Brad; Berczuk, Stephen; Cabrera, Ralph; Orenstein, Robert (1998-02-08). "Streamed Lines: Branching Patterns for Parallel Software Development" (PDF). Hillside. Retrieved 2009-08-12.
- ^ Bailey, Derick (2009-07-15). "Part 1: Why". Branch-Per-Feature Source Control. Los techies. Retrieved 2009-08-12.
- ^ Wallen, Jack (2020-09-22). "GitHub to replace master with main starting in October: What developers need to do now". TechRepublic. Retrieved 2022-04-24.
- ^ Heinze, Carolyn (2020-11-24). "Why GitHub renamed its master branch to main". TheServerSide. Retrieved 2022-04-24.