Git

from Wikipedia, the free encyclopedia
Git

logo
Basic data

Maintainer Junio ​​Hamano
developer Junio ​​C. Hamano, Shawn O. Pearce, Linus Torvalds, and others. v. a.
Publishing year 2005
Current  version 2.28.0
( July 27, 2020 )
operating system Linux , FreeBSD , macOS , Solaris, etc. a. unixoide ; Windows ; Haiku ; ...
programming language C , Unix Shell , Perl , Tcl , Python , C ++
category Version management
License GNU General Public License, version 2
German speaking Yes
git-scm.com

Git [ ɡɪt ] is a free software for the distributed version management of files , which was initiated by Linus Torvalds .

history

Through a license change in use of the hitherto proprietary BitKeeper system's could Linux - kernel developers denied this no longer free to use, and thus remained many developers access. Linus Torvalds therefore started developing new source code management software in April 2005 and presented a first version just a few days after it was announced.

Old logo

Torvalds wanted a distributed system that can be used like BitKeeper and that meets the following requirements:

  1. Support of distributed, BitKeeper-like workflows
  2. Very high security against both unintentional and malicious falsification
  3. high efficiency

An existing project called Monotone met the first two requirements, but none of the existing systems met the third criterion.

Torvalds decided against adapting Monotone to his needs and instead began developing his own system. One of the main reasons for this step was the way of working, which Torvald believes Monotone is optimized for. Torvalds argued that importing individual revisions from another developer into your own development branch would lead to cherry-picking and messy repositories. If, on the other hand, entire branches are always imported, developers would be forced to clean up. Throwaway branches are necessary for this.

“This is my only real conceptual gripe with 'monotone'. I like the model, but they make it much harder than it should be to have throw-away trees due to the fact that they seem to be working on the assumption of 'one database per developer' rather than 'one database per tree'. You don't have to follow that model, but it seems to be what the setup is geared for, and together with their 'branches' it means that I think a monotone database easily gets very cruddy. The other problem with monotone is just performance right now, but that's hopefully not too fundamental. "

“I have only one real conceptual problem with 'monotone': I like the way it works, but it makes throwaway trees difficult to use because the concept seems to be based on the assumption of 'one database per developer' rather than 'one database per tree'. While there is no need to follow this model, the system setup appears to be geared towards it. Together with their 'branches', I fear that the monotonous database will quickly become dirty. Another, hopefully not too fundamental problem is the current performance of monotone. "

- Linus Torvalds

Git's design uses some ideas from Monotone and BitKeeper, but no source code from them. It should explicitly be an independent version management system.

The current maintainer of Git is Junio ​​Hamano.

Surname

The name "Git" means something like "fool" in British colloquial language. Linus Torvalds explained his choice of the unusual name with a joke and with the fact that the word was practicable and largely unused in the software world:

“I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'Git'. ”

“I'm a selfish bastard and I name all of my projects after me. First 'Linux', now 'Git'. "

- Linus Torvalds

“The joke 'I name all my projects for myself, first Linux, then git' was just too good to pass up. But it is also short, easy-to-say, and type on a standard keyboard. And reasonably unique and not any standard command, which is unusual. "

“The joke 'I name all my projects after me, first Linux, now Git' was just too good not to do it. But it (the command) is also short, just pronouncing it and typing it on a standard keyboard, somewhat unique and not an ordinary standard command - very unusual. "

- Linus Torvalds

The name Linux was not initially promoted by Torvalds himself and was only accepted reluctantly.

properties

Data flow

Git is a distributed version control system that differs from typical version control systems in some features:

Non-linear development

Development history with extensively used branching and merging

Both the creation of new development branches ( branching ) and the merging of two or more branches ( merging ) are integral parts of working with Git and built into the Git tools. Git contains programs with the help of which the non-linear history of a project can be easily visualized and with the help of which one can navigate in this history. Branches in Git are implemented very effectively (in contrast to other SCMs ): A branch is just a reference , or ref , a text file with a commit ID, which is stored in a repository in the directory .git/refs/heads(e.g. . .git/refs/heads/masterfor the master branch) and refers to a specific commit . The branch structure can be reconstructed using its parental commits . These properties allow very large and efficient development structures to be implemented, such as Git itself or the Linux kernel, in which every feature and every developer has a branch or its own repository from which the project manager ("maintainer") then commits can be transferred to the main branch of the project (master) via merge or cherry pick (use of individual commits).

No central server

Decentralized management of the entire repository using Git

Every user has a local copy of the entire repository, including the version history . Most actions can be carried out locally and without network access. No distinction is made between local development branches and development branches of remote repositories. Although there is no technical difference between different repositories (apart from the one between normal and bare repositories on servers that do not have a working tree , i.e. the real files), the copy that is referenced from a project homepage applies often as the official repository into which the developers' revisions are posted. There are special remote tracking branches , which are references (see non-linear development ) that point to the status of another repository.

Data transfer between repositories

In addition to being transferred at the file system level ( file://), data can also be transferred between repositories using different network protocols. Git has its own, very efficient protocol that uses the TCP port 9418 ( git://), which can only be used for fetching and cloning , i.e. reading a repository. The transfer can also take place via SSH ( ssh://, the most common protocol for write operations), HTTP ( http://), HTTPS ( https://) or (less efficient) FTP ( ftp://) or rsync ( rsync://). The transfer to the official repository of a project often takes the form of patches that are sent via email to the developer or to a development mailing list . Alternatively, a review system such as Gerrit can be used. For projects that are stored ("hosting") on websites like GitHub or Bitbucket , a change can be suggested simply by pushing a branch, which is then merged into the project if necessary .

Cryptographic security of the project history

Damaged object

The history of a project is saved in such a way that the hash value of any revision (commit) is based on the complete history that led to this revision. This means that it is not possible to manipulate the version history retrospectively without changing the hash value of the revision. In cryptography, this is called a hash tree . Individual revisions can also be marked (tagging) and optionally digitally signed with GPG (signed tag) , for example to identify the status at the time a new version of the software was released.

Storage system and file versioning

There are version control systems (for example CVS ) that maintain separate revision numbers for each file (and each directory) that are independent of all other files. A new number is only generated for a file if the respective file is part of a commit operation. In contrast to this, Git assigns all files (and directories) managed in the repository a new revision number that is the same for all files on each commit. Saving itself is done by storing a reference to the project root as a tree object in the commit object , which in turn contains references to blobs ( binary large objects , the pure contents of the files without identification) and other trees (directories). A tree object refers (like a directory inode ) with its entries to SHA1 checksums, which identify further trees and blobs , similar to inode numbers in file systems. If a file is not changed in a commit, the checksum does not change either, and it does not need to be saved again. The objects are in the project under .git/objects. Using Git “on-board tools”, any commit can be uniquely identified using the assigned hash value (the checksum), read out separately, merged or even used as a branch point - comparable to the revision numbers in other systems.

Clean up the repository

The data of deleted and undone actions and development branches remain (and can be recovered) until they are explicitly deleted.

Interoperability

There are utilities that provide interoperability between Git and other version control systems. Such utility programs exist for GNU arch (git-archimport) , CVS (git-cvsexportcommit , git-cvsimport and git-cvsserver) , Darcs ( darcs-fastconvert , darcs2git and others), Quilt (git-quiltimport) and Subversion (git -svn) .

Web interface

Gitweb with the differences between two commits

With Gitweb there is a web interface written in Perl. The Team Foundation Server from Microsoft has a Git connection ( Git-tf ).

distribution

According to the Open Hub , around 69% of all software projects registered there used Git in April 2019. This means that Git dominates by a large margin compared to the next-placed Subversion , which achieved 25%.

use

The current version is used productively for the development of many projects, both commercially and in the open source area, often on platforms such as GitHub , GitLab , or BitBucket . Git is used for version management of the Linux kernel or, after Microsoft's switch to Git 2017, by Microsoft Windows .

Management of content

Although Git was primarily developed for versioning source code, it is also used to store flat-structured (as opposed to relational structures ) data sets directly as a file . Functions such as version management, hook , diff , replication and offline use can also be used for content without a database . The usage is similar to NoSQL , even if Git does not allow index structure , query or simultaneity.

The use also extends to systems with simply structured content such as CMS or wikis .

Supported Operating Systems

Unix / Linux

Git runs on almost all modern Unix-like systems such as Linux , Solaris , macOS , FreeBSD , DragonFly BSD , NetBSD , OpenBSD , AIX , IRIX .

Apple ships macOS with a slightly modified Git version. This is mainly used to increase compatibility with Apple's Xcode development environment .

Windows

There are several ports of Git for Microsoft Windows:

  • Git for Windows, the port of the Git project (previously developed under the name msysGit ). Can also be used via PowerShell with the posh-git module .
  • The Cygwin environment includes Git.

TortoiseGit is an extension for Windows Explorer ( Windows Shell Extension ), so that Git can be used under Windows without a command line. TortoiseGit also requires a Git installation, usually Git for Windows .

GUIs

literature

Web links

Commons : Git  - collection of images, videos and audio files

Individual evidence

  1. Junio ​​Hamano: [ANNOUNCE] Git v2.28.0 . July 27, 2020 (accessed July 27, 2020).
  2. Junio ​​Hamano: Git 2.28 Now Shipping With Feature For Configurable Default / Main Branch Name . July 27, 2020 (accessed July 27, 2020).
  3. The git Open Source Project on Open Hub: Languages ​​Page . In: Open Hub . (accessed on July 14, 2018).
  4. Copying . (English, accessed on August 5, 2018).
  5. a b Linus Torvalds: Kernel SCM saga .. In: Linux Kernel Archive. April 6, 2005, accessed August 5, 2018 .
  6. Alexander Neumann: 10 years ago: Linus Torvalds builds Git. In: Heise online . April 8, 2015, accessed August 5, 2018 .
  7. Git FAQ: Why the 'Git' name? March 9, 2013, accessed August 5, 2018 .
  8. ^ Robert McMillan: Lord of the Files: How GitHub Tamed Free Software (And More). In: Wired . February 21, 2012, accessed August 6, 2018 .
  9. See the history of Linux #The name Linux
  10. Chapter 1. Repositories and Branches. In: Git User's Manual. Accessed August 5, 2018 .
  11. Exporting a git repository via http. In: Git User's Manual. Accessed August 5, 2018 .
  12. Submitting patches to a project. In: Git User's Manual. Accessed August 5, 2018 .
  13. Compare Repositories - Open Hub. Open Hub, accessed April 26, 2019 .
  14. ^ GitLab Documentation. Accessed August 5, 2018 .
  15. Rainald Menge-Sonnentag: Microsoft is now using Git for Windows development. Heise online , 23 August 2017, accessed on 5 August 2018 .
  16. a b Brandon Keepers: Git: the NoSQL Database. April 21, 2012, accessed August 5, 2018 .
  17. Adam Feber: How We Moved 2.3 Million Wiki Pages to Git. (No longer available online.) February 4, 2014, archived from the original on August 10, 2016 ; accessed on February 3, 2019 .
  18. gollum - A git-based Wiki. Accessed August 5, 2018 .
  19. Are there any differences with the git provided by Apple and the official git? Retrieved April 18, 2019 .
  20. Alexander Neumann: Git for Windows leaves preview status. Heise online , August 19, 2015, accessed on August 5, 2018 .
  21. ^ Relationship to Git for Windows. Accessed August 5, 2018 .
  22. Git - Git in PowerShell. Retrieved July 18, 2020 .
  23. Frequently asked questions (FAQ). What are the system prerequisites of TortoiseGit? In: tortoisegit.org. Retrieved April 26, 2019 .