Distributed version control

Short description: Software engineering tool

The process of initializing a git repository. Git is one of the most popularly used distributed version control software.

In software development, distributed version control (also known as distributed revision control) is a form of version control in which the complete codebase, including its full history, is mirrored on every developer's computer.[1] Compared to centralized version control, this enables automatic management branching and merging, speeds up most operations (except pushing and fetching), improves the ability to work offline, and does not rely on a single location for backups.[1][2][3] Git, the world's most popular version control system,[4] is a distributed version control system.

## Contents

* 1 Distributed vs. centralized
* 2 Work model
* 2.1 Central and branch repositories
* 2.2 Pull requests
* 3 History
* 4 See also
* 5 References
* 6 External links

## Distributed vs. centralized

Distributed version control systems (DVCS) use a peer-to-peer approach to version control, as opposed to the client–server approach of centralized systems. Distributed revision control synchronizes repositories by transferring patches from peer to peer. There is no single central version of the codebase; instead, each user has a working copy and the full change history.

Advantages of DVCS (compared with centralized systems) include:

* Allows users to work productively when not connected to a network.
* Common operations (such as commits, viewing history, and reverting changes) are faster for DVCS, because there is no need to communicate with a central server.[5] With DVCS, communication is necessary only when sharing changes among other peers.
* Allows private work, so users can use their changes even for early drafts they do not want to publish.[citation needed]
* Working copies effectively function as remote backups, which avoids relying on one physical machine as a single point of failure.[5]
* Allows various development models to be used, such as using development branches or a Commander/Lieutenant model.[6]
* Permits centralized control of the "release version" of the project[citation needed]
* On FOSS software projects it is much easier to create a project fork from a project that is stalled because of leadership conflicts or design disagreements.

Disadvantages of DVCS (compared with centralized systems) include:

* Initial checkout of a repository is slower as compared to checkout in a centralized version control system, because all branches and revision history are copied to the local machine by default.
* Additional storage required for every user to have a complete copy of the complete codebase history.[7]
* Increased exposure of the code base since every participant has a locally vulnerable copy.[citation needed]

Some originally centralized systems now offer some distributed features. Team Foundation Server and Visual Studio Team Services now host centralized and distributed version control repositories via hosting Git.

Similarly, some distributed systems now offer features that mitigate the issues of checkout times and storage costs, such as the Virtual File System for Git developed by Microsoft to work with very large codebases,[8] which exposes a virtual file system that downloads files to local storage only as they are needed.

## Work model

A distributed model is generally better suited for large projects with partly independent developers, such as the Linux Kernel. It allows developers to work in independent branches and apply changes that can later be committed, audited and merged (or rejected)[9] by others. This model allows for better flexibility and permits for the creation and adaptation of custom source code branches (forks) whose purpose might differ from the original project. In addition, it permits developers to locally clone an existing code repository and work on such from a local environment where changes are tracked and committed to the local repository[10] allowing for better tracking of changes before being committed to the master branch of the repository. Such an approach enables developers to work in local and disconnected branches, making it more convenient for larger distributed teams.

### Central and branch repositories

In a truly distributed project, such as Linux, every contributor maintains their own version of the project, with different contributors hosting their own respective versions and pulling in changes from other users as needed, resulting in a general consensus emerging from multiple different nodes. This also makes the process of "forking" easy, as all that is required is one contributor stop accepting pull requests from other contributors and letting the codebases gradually grow apart.

This arrangement, however, can be difficult to maintain, resulting in many projects choosing to shift to a paradigm in which one contributor is the universal "upstream", a repository from whom changes are almost always pulled. Under this paradigm, development is somewhat recentralized, as every project now has a central repository that is informally considered as the official repository, managed by the project maintainers collectively. While distributed version control systems make it easy for new developers to "clone" a copy of any other contributor's repository, in a central model, new developers always clone the central repository to create identical local copies of the code base. Under this system, code changes in the central repository are periodically synchronized with the local repository, and once the development is done, the change should be integrated into the central repository as soon as possible.

Organizations utilizing this centralize pattern often choose to host the central repository on a third party service like GitHub, which offers not only more reliable uptime than self-hosted repositories, but can also add centralized features like issue trackers and continuous integration.

### Pull requests

Contributions to a source code repository that uses a distributed version control system are commonly made by means of a pull request, also known as a merge request.[11] The contributor requests that the project maintainer pull the source code change, hence the name "pull request". The maintainer has to merge the pull request if the contribution should become part of the source base.[12]

The developer creates a pull request to notify maintainers of a new change; a comment thread is associated with each pull request. This allows for focused discussion of code changes. Submitted pull requests are visible to anyone with repository access. A pull request can be accepted or rejected by maintainers.[13]

Once the pull request is reviewed and approved, it is merged into the repository. Depending on the established workflow, the code may need to be tested before being included into official release. Therefore, some projects contain a special branch for merging untested pull requests.[12][14] Other projects run an automated test suite on every pull request, using a continuous integration tool, and the reviewer checks that any new code has appropriate test coverage.

## History

The first open-source DVCS systems included Arch, Monotone, and Darcs. However, open source DVCSs were never very popular until the release of Git and Mercurial.

BitKeeper was used in the development of the Linux kernel from 2002 to 2005.[15] The development of Git, now the world's most popular version control system,[4] was prompted by the decision of the company that made BitKeeper to rescind the free license that Linus Torvalds and some other Linux kernel developers had previously taken advantage of.[15]

## See also

* Version control
* List of version-control software
* Comparison of version-control software
* Repository clone
* Git, an open source DVCS developed for Linux Kernel development
* Mercurial, a cross-platform system similar to Git
* Fossil, a distributed version control system, bug tracking system and wiki software
* BitKeeper
* GNU Bazaar
* Darcs
* Concurrent Versions System, a predecessor of distributed version control systems
* TortoiseHg, a graphical interface for Mercurial
* Code Co-op, a peer-to-peer version control system

## References

1. ↑ 1.0 1.1 Chacon, Scott; Straub, Ben (2014). "About version control". Pro Git (2nd ed.). Apress. Chapter 1.1. https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control. Retrieved 4 June 2019.
2. ↑ Spolsky, Joel (17 March 2010). "Distributed Version Control Is Here to Stay, Baby". Joel on Software. http://joelonsoftware.com/items/2010/03/17.html.
3. ↑ "Intro to Distributed Version Control (Illustrated)". https://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/.
4. ↑ 4.0 4.1 "Version Control Systems Popularity in 2016". https://rhodecode.com/insights/version-control-systems-2016.
5. ↑ 5.0 5.1 O'Sullivan, Bryan. "Distributed revision control with Mercurial". http://hgbook.red-bean.com/hgbook.html.
6. ↑ Chacon, Scott; Straub, Ben (2014). "Distributed workflows". Pro Git (2nd ed.). Apress. Chapter 5.1. https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows.
7. ↑ "What is version control: centralized vs. DVCS". 14 February 2012. https://www.atlassian.com/blog/software-teams/version-control-centralized-dvcs.
8. ↑ Jonathan Allen (2017-02-08). "How Microsoft Solved Git's Problem with Large Repositories". https://www.infoq.com/news/2017/02/GVFS/.
9. ↑ "Submitting patches: the essential guide to getting your code into the kernel — The Linux Kernel documentation". https://www.kernel.org/doc/html/v5.1/process/submitting-patches.html.
10. ↑ "Git - Revision Selection". https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection.
11. ↑ Sijbrandij, Sytse (29 September 2014). "GitLab Flow". https://about.gitlab.com/2014/09/29/gitlab-flow/.
12. ↑ 12.0 12.1 Johnson, Mark (8 November 2013). "What is a pull request?". http://oss-watch.ac.uk/resources/pullrequest.
13. ↑ "Using pull requests". GitHub. https://help.github.com/articles/using-pull-requests/.
14. ↑ "Making a Pull Request". Atlassian. https://www.atlassian.com/git/tutorials/making-a-pull-request.
15. ↑ 15.0 15.1 McAllister, Neil. "Linus Torvalds' BitKeeper blunder" (in en). InfoWorld. http://www.infoworld.com/article/2670360/operating-systems/linus-torvalds--bitkeeper-blunder.html.

## External links

* Essay on various revision control systems, especially the section "Centralized vs. Decentralized SCM"
* Introduction to distributed version control systems \- IBM Developer Works article

* v
* t
* e

Version control software

Years, where available, indicate the date of first stable release. Systems with names in italics are no longer maintained or have planned end-of-life dates.

Local only|

| Free/open-source|

* RCS (1982)
* SCCS (1972)

|

Proprietary|

* PVCS (1985)
* QVCS (1991)

Client–server|

| Free/open-source|

* CVS (1986, 1990 in C)
* CVSNT (1998)
* QVCS Enterprise (1998)
* Subversion (2000)

|

Proprietary|

* AccuRev SCM (2002)
* Azure DevOps
* Server (via TFVC) (2005)
* Services (via TFVC) (2014)
* ClearCase (1992)
* CMVC (1994)
* Dimensions CM (1980s)
* DSEE (1984)
* Endevor (1980s)
* Integrity (2001)
* Panvalet (1970s)
* Perforce Helix (1995)
* SCLM (1980s?)
* Software Change Manager (1970s)
* StarTeam (1995)
* Surround SCM (2002)
* Synergy (1990)
* Team Concert (2008)
* Vault (2003)
* Visual SourceSafe (1994)

Distributed|

| Free/open-source|

* ArX (2003)
* BitKeeper (2000)
* Codeville (2005)
* Darcs (2002)
* DCVS (2002)
* Fossil (2007)
* Git (2005)
* GNU arch (2001)
* GNU Bazaar (2005)
* Mercurial (2005)
* Monotone (2003)
* Veracity (2010)

|

Proprietary|

* Azure DevOps
* Server (via Git) (2013)
* Services (via Git) (2014)
* TeamWare (1992)
* Code Co-op (1997)
* Plastic SCM (2006)

Concepts|

* Baseline
* Branch
* Changeset
* Commit
* Data comparison
* Delta compression
* Fork
* Gated commit
* Interleaved deltas
* Merge
* Monorepo
* Repository
* Tag
* Trunk

* Category
* Comparison
* List

de:Versionsverwaltung#Verteilte Versionsverwaltung fr:Gestion de version décentralisée ja:分散型バージョン管理システム

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Distributed version control. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Distributed_version_control&oldid=3988995"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template