- Related Topics:
- open source
- GitHub
- distributed version control system
Git
-
What is Git in computing?
Git, created in 2005 by Linus Torvalds, is a widely used, open-source, distributed version control system (DVCS). It serves as a "shared digital diary" for code, managing and tracking changes made by developers.
Git allows developers to pull source code into their personal "branch," a copy of the main repository. Here, they can make changes and then "commit" the code, merging changes into the repository or keeping them in a separate file. This system enables effective collaboration by merging committed code into the main repository without conflicts.
Platforms like GitHub and GitLab use Git to help developers collaborate more effectively. GitHub expanded Git by creating a public forum where developers can view multiple projects and improve their own work.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
Why do programmers use Git?
Git is a distributed version control system (DVCS) that helps developers manage and track changes to their code. It functions as a shared digital diary for code, allowing developers to pull source code into their personal branch, make changes, and then commit the code. Git facilitates collaboration by enabling developers to merge their committed code into the main repository without conflicts or overwriting each other's work.
Linus Torvalds created Git in 2005 because existing systems struggled with larger code changes and had bugs. Today, Git is the most widely used version control system, employed by individuals and companies like Microsoft, Netflix, and Google. Despite some criticisms regarding its user interface, a survey in 2023 indicated that 93% of software developers use Git as their primary version control system.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
What does it mean to 'commit' changes in Git?
In Git, "committing" refers to saving changes to the repository. When developers use Git, they can extract source code into their own personal "branch," which is a copy of the main repository where all changes to source code are tracked. After a developer creates the branch, they can make the necessary changes and then "commit" the code. This allows developers to merge their changes into the repository or keep the changes in a separate file.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
How does Git help people work together on code?
Git is a distributed version control system (DVCS) that helps developers collaborate effectively by managing and tracking changes to code. It allows developers to pull source code into their personal branch, make necessary changes, and then commit the code. Git functions as a shared digital diary for code, allowing developers to merge their committed code into the main repository without conflicts or unknowingly overwriting one anotherâs work. Both GitHub and GitLab are cloud-based services that use Git to help developers collaborate more effectively.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
What is a 'branch' in Git and why is it useful?
In Git, a branch allows developers to work on a copy of the main repository, without altering the primary codebase. Developers can pull source code into their personal "branch," where they can make necessary changes and then "commit" the code.
Once changes are complete, the developer can merge their code into the main repository or keep the changes in a separate file. This system promotes collaboration by allowing developers to merge committed code without conflicts or overwriting each other's work.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
How does Git keep track of different versions of files?
Git, a distributed version control system (DVCS), serves as a "shared digital diary" for code, managing and tracking changes made by developers. Git allows developers to pull source code into their personal "branch," a copy of the main repository where all changes to source code are tracked. After creating a branch, developers can make changes and then "commit" the code, merging their changes into the repository or keeping them in a separate file. This DVCS system enables effective collaboration by merging committed code into the main repository without conflicts or overwriting others' work.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.
Git, open-source distributed version control system (DVCS) created by Linux developer Linus Torvalds in 2005. As of 2024 Git is the most widely used version control system and is used by both individuals and companies including Microsoft, Netflix, and Google.
- GitHub: cloud-based service owned by Microsoft, founded in 2008
- GitLab: GitHub alternative with a free version, founded in 2011
Both GitHub and GitLab function as software code repositories that use Git to help developers collaborate more effectively.
When developers write code, they generally rely on a DVCS, which functions as a sort of âshared digital diaryâ for code, to manage and track changes. When using Git, developers can pull source code into their personal âbranch,â which is a copy of the main repositoryâwhere all changes to source code are tracked. Once a developer creates the branch, they can make necessary changes, and then âcommitâ the code. This means that developers can either merge their changes into the repository or keep the changes in a separate file. A DVCS allows developers to effectively collaborate by merging their committed code into the main repository without conflicts or unknowingly overwriting one anotherâs work.
In the early 1990s, when Linux was still a new technology, developers worked without a DVCS. When developers posted changes to the open-source operating system, Torvalds would manually apply the changes to his source code and eventually release an updated version. Changes were marked only with a âdiffâ tag in the code. The concurrent version systems (CVS) available for version control at the time struggled to categorize larger code changes and were susceptible to bugs, and Torvalds disliked other open-source options. In 2002 Torvalds and Linux introduced and began to use the version control system BitKeeperâa proprietary DVCS owned by BitMover. Torvalds, who had not originally wanted to rely on a version control system, said BitKeeper âchanged the way [he] viewed source control.â
âI had performance requirements that were not even remotely satisfied by what was available, and I also worried about integrity of the code and the whole workflow, so I ended up just deciding to write my own.â âTorvalds in a 2015 Linux Foundation interview
However, many Linux developers were devoted to the philosophy behind open source, which rejected secrecy in favor of collaborative, open sharing in the programming world. Many developers voiced their frustration to Torvalds, and some refused to work with BitKeeper at all. The breaking point occurred when Torvaldsâs collaborator Andrew Tridgell reverse-engineered BitKeeper protocol to such a degree in an attempt to bypass BitMoverâs usage rules that mediation with BitMover was required. âI decided that I canât continue using BK, but that I really didnât want to go back to the bad old pre-BK days,â Torvalds recalled in a 2015 interview with the Linux Foundation. Thus the idea of Git was born.
Gitâs initial framework came together in a little over a week. The program handled version control for Linux projects but soon expanded to other collaborative and open-source projects. Git has occasionally been criticized for its complicated user interface, with even prolific developer Andrew Morton saying that Git is âexpressly designed to make you feel less intelligent than you thought you were.â Still, Torvalds maintains that such user experience differences from other DVCS and CVS products are necessary for Git to function. In 2023 Stack Overflow, a coding forum site, reported that its survey of more than 73,000 software developers had found that 93 percent of respondents were using Git as their primary version control system.

" height="20" alt="HEW Logo">