Difference between revisions of "Git"
(Git is a distributed version-control system for tracking changes in source code during software development.) |
(→Servers: add link) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | [https://git-scm.com/ Git] is a version control system used by I2P, replacing the previous system [[Monotone]] in late 2020.<ref>http://i2p-projekt.i2p/en/blog/post/2020/12/10/Hello-git-goodbye-mtn</ref> |
||
− | {{short description|Free and open source revision control software}} |
||
− | {{Other uses|Git (disambiguation)}} |
||
− | {{Use dmy dates|date=March 2012}} |
||
+ | == Usage & tips == |
||
− | {{Infobox software |
||
− | | name = Git |
||
− | | logo = [[File:Git-logo-2012.svg|150px]] |
||
− | | screenshot = Git session.svg |
||
− | | caption = A command-line session showing repository creation, addition of a file, and remote synchronization |
||
− | | author = [[Linus Torvalds]]<ref name="git-initial-commit">{{cite web |
||
− | | url = https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290 |
||
− | | date = 8 April 2005 |
||
− | | title = Initial revision of "git", the information manager from hell |
||
− | | publisher = [[GitHub]] |
||
− | | accessdate = 20 December 2015 |
||
− | | url-status = live |
||
− | | archiveurl = https://web.archive.org/web/20151116175401/https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290 |
||
− | | archivedate = 16 November 2015 |
||
− | | df = dmy-all}}</ref> |
||
− | | developer = Junio Hamano and others<ref name="git-commits">{{cite web |
||
− | | url = https://github.com/git/git/graphs/contributors |
||
− | | date = 8 June 2016 |
||
− | | title = Commit Graph |
||
− | | publisher = [[GitHub]] |
||
− | | accessdate = 19 December 2015 |
||
− | | url-status = live |
||
− | | archiveurl = https://web.archive.org/web/20160120121816/https://github.com/git/git/graphs/contributors |
||
− | | archivedate = 20 January 2016 |
||
− | | df = dmy-all}}</ref> |
||
− | | released = {{Start date and age|2005|04|07|df=yes}} |
||
− | | latest release version = 2.25.0 |
||
− | | latest release date = {{release date and age|2020|01|13|df=yes}}<ref>{{cite web |
||
− | | url = https://github.com/git/git/releases |
||
− | | accessdate = 14 January 2020 |
||
− | | title = Releases - git/git}}</ref> |
||
− | | programming language = [[C (programming language)|C]], [[Shell (computing)|Shell]], [[Perl]], [[Tcl]], [[Python (programming language)|Python]]<ref>{{cite web |
||
− | | url = https://github.com/git/git |
||
− | | title = Git Source Code Mirror |
||
− | | accessdate = 1 January 2017 |
||
− | | url-status = live |
||
− | | archiveurl = https://web.archive.org/web/20170208051639/https://github.com/git/git |
||
− | | archivedate = 8 February 2017 |
||
− | | df = dmy-all}}</ref> |
||
− | | operating system = [[POSIX]]: [[Linux]], [[Microsoft Windows|Windows]], [[macOS]] |
||
− | | size = |
||
− | | language = English |
||
− | | genre = [[Version control]] |
||
− | | license = [[GNU General Public License|GPLv2]],<ref name="license_gpl">{{cite web |
||
− | | url = https://github.com/git/git/blob/master/COPYING |
||
− | | title = Git's GPL license at github.com |
||
− | | date = 18 January 2010 |
||
− | | website = [[GitHub]] |
||
− | | accessdate = 12 October 2014 |
||
− | | url-status = live |
||
− | | archiveurl = https://web.archive.org/web/20160411135124/https://github.com/git/git/blob/master/COPYING |
||
− | | archivedate = 11 April 2016 |
||
− | | df = dmy-all}}</ref> [[GNU Lesser General Public License|LGPLv2.1]],<ref name="license_lgpl">{{cite web |
||
− | | url = https://github.com/git/git/blob/master/LGPL-2.1 |
||
− | | title = Git's LGPL license at github.com |
||
− | | date = 20 May 2011 |
||
− | | website = [[GitHub]] |
||
− | | accessdate = 12 October 2014 |
||
− | | url-status = live |
||
− | | archiveurl = https://web.archive.org/web/20160411135049/https://github.com/git/git/blob/master/LGPL-2.1 |
||
− | | archivedate = 11 April 2016 |
||
− | | df = dmy-all}}</ref> and others |
||
− | | website = {{URL|https://git-scm.com}} |
||
− | | repo = <!-- Taken from Wikidata --> |
||
− | | standard = |
||
− | | AsOf = |
||
− | }} |
||
+ | === Telling Git to use I2P === |
||
− | '''Git''' ({{IPAc-en|g|ɪ|t}})<ref name=":0">{{cite web |url = https://www.youtube.com/watch?v=4XpnKHJAok8&t=1m30s |title = Tech Talk: Linus Torvalds on git (at 00:01:30) |publisher = YouTube |accessdate = 2014-07-20 |url-status = live |archiveurl = https://web.archive.org/web/20151220133030/https://www.youtube.com/watch?v=4XpnKHJAok8&t=1m30s |archivedate = 20 December 2015 |df = dmy-all}}</ref> is a [[distributed version control|distributed version-control]] system for tracking changes in [[source code]] during [[software development]].<ref name="effcomp">{{cite book |last1 = Scopatz |first1 = Anthony |last2 = Huff |first2 = Kathryn D. |title = Effective Computation in Physics |date = 2015 |publisher = O'Reilly Media, Inc. |isbn = 9781491901595 |page = 351 |url = https://books.google.de/books?id=DYoNCgAAQBAJ&pg=PA351 |accessdate = 20 April 2016 |url-status = live |archiveurl = https://web.archive.org/web/20160507172519/https://books.google.de/books?id=DYoNCgAAQBAJ&pg=PA351 |archivedate = 7 May 2016 |df = dmy-all}}</ref> It is designed for coordinating work among [[programmer]]s, but it can be used to track changes in any set of [[computer file|files]]. Its goals include speed,<ref name="kernel_SCM_saga">{{cite mailing list |mailinglist = linux-kernel |last = Torvalds |first = Linus |url = https://marc.info/?l=linux-kernel&m=111288700902396 |title = Re: Kernel SCM saga.. |date = 2005-04-07}} "So I'm writing some scripts to try to track things a whole lot faster."</ref> [[data integrity]],<ref name="integrity_goals">{{cite mailing list |last = Torvalds |first = Linus |authorlink = Linus Torvalds |mailinglist = git |date = 2007-06-10 |title = Re: fatal: serious inflate inconsistency |url = https://marc.info/?l=git&m=118143549107708}}</ref> and support for distributed, non-linear workflows.<ref name="linusGoogleTalk">{{cite video |people = Linus Torvalds |date = 2007-05-03 |url = https://www.youtube.com/watch?v=4XpnKHJAok8 |title = Google tech talk: Linus Torvalds on git |time = 02:30 |accessdate = 2007-05-16 |url-status = live |archiveurl = https://web.archive.org/web/20070528041814/http://www.youtube.com/watch?v=4XpnKHJAok8 |archivedate = 28 May 2007 |df = dmy-all}}</ref> |
||
+ | To use HTTP/Git-based I2P servers, Git's proxy settings must be configured. This can be achieved by adding these lines to your <code>~/.gitconfig</code> (create if necessary): |
||
+ | <nowiki>[http] |
||
+ | proxy = http://127.0.0.1:4444 |
||
+ | [https] |
||
+ | proxy = http://127.0.0.1:4444 |
||
+ | [git] |
||
+ | proxy = http://127.0.0.1:4444</nowiki> |
||
+ | If the proxy is needed for only a few repos, one can also utilize the <code>-c</code> of Git: |
||
+ | <nowiki>git -c http.proxy=http://127.0.0.1:4444 clone http://example.i2p/myrepo.git</nowiki> |
||
+ | Note that this method doesn't store the proxy information within the repo configuration, so the same <code>-c http.proxy=...</code> settings must be applied on each invocation. |
||
+ | === Limit fetched commits === |
||
− | Git was created by [[Linus Torvalds]] in 2005 for development of the [[Linux kernel]], with other kernel developers contributing to its initial development.<ref name="pro-git-1.2">{{cite book |chapter-url = https://git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git |chapter = A Short History of Git |title = Pro Git |publisher = Apress |accessdate = 26 December 2015 |date = 2014 |edition = 2nd |url = https://git-scm.com/book/en/v2 |url-status = live |archiveurl = https://web.archive.org/web/20151225223054/http://git-scm.com/book/en/v2 |archivedate = 25 December 2015 |df = dmy-all}}</ref> Its current maintainer since 2005 is Junio Hamano. As with most other distributed version-control systems, and unlike most [[client–server]] systems, every Git [[directory (computing)|directory]] on every [[node (networking)|computer]] is a full-fledged [[Repository (version control)|repository]] with complete history and full version-tracking abilities, independent of network access or a central server.<ref>{{cite book |last1 = Chacon |first1 = Scott |title = Pro Git |date = 24 December 2014 |publisher = [[Apress]] |location = New York, NY |isbn = 978-1-4842-0077-3 |pages = 29–30 |edition = 2nd |url = https://git-scm.com/book/en/v2 |url-status = live |archiveurl = https://web.archive.org/web/20151225223054/http://git-scm.com/book/en/v2 |archivedate = 25 December 2015 |df = dmy-all}}</ref> Git is [[free and open-source software]] distributed under the terms of the [[GNU General Public License]] version 2. |
||
+ | Git (by default) fetches the full history of a repo, which can be hard for I2P connections to sustain. Git provides the <code>--depth=N</code> argument to only fetch N commits from the top: |
||
+ | <nowiki>git clone --depth=1 http://git.idk.i2p/i2p-hackers/i2p.i2p.git</nowiki> |
||
+ | The repository can then (step-by-step if needed) be unshallowed by <code>git pull --deepen=N</code>. |
||
+ | === Hide timezone === |
||
− | ==History== |
||
+ | Git shows the local timezone in commits. You might want to change that to something more generic, such as UTC. |
||
− | Git development began in April 2005, after many developers of the [[Linux kernel]] gave up access to [[BitKeeper]], a proprietary source-control management (SCM) system that they had formerly used to maintain the project.<ref name="linux.com44147">[https://www.linux.com/news/bitkeeper-and-linux-end-road BitKeeper and Linux: The end of the road? |linux.com] {{webarchive|url=https://web.archive.org/web/20170608224906/https://www.linux.com/news/bitkeeper-and-linux-end-road |date=8 June 2017}}</ref> The copyright holder of BitKeeper, [[Larry McVoy]], had withdrawn free use of the product after claiming that [[Andrew Tridgell]] had created [[SourcePuller]] by [[reverse engineering]] the BitKeeper protocols.<ref name="infoworld bit keeper">{{cite news |last= McAllister |first= Neil |url= http://www.infoworld.com/article/2670360/operating-systems/linus-torvalds--bitkeeper-blunder.html |title= Linus Torvalds' BitKeeper blunder |work= InfoWorld |publisher= IDG |date= 2005-05-02 |access-date= 2015-09-08 |url-status= live |archiveurl= https://web.archive.org/web/20150826064920/http://www.infoworld.com/article/2670360/operating-systems/linus-torvalds--bitkeeper-blunder.html |archivedate= 26 August 2015 |df= dmy-all}}</ref> The same incident also spurred the creation of another version-control system, [[Mercurial]]. |
||
+ | <nowiki>git commit --date="`date --utc +%Y-%m-%dT%H:%M:%S%z`" -m "added new feature"</nowiki> |
||
− | [[Linus Torvalds]] wanted a distributed system that he could use like BitKeeper, but none of the available free systems met his needs. Torvalds cited an example of a source-control management system needing 30 seconds to apply a patch and update all associated metadata, and noted that this would not scale to the needs of Linux kernel development, where synchronizing with fellow maintainers could require 250 such actions at once. For his design criteria, he specified that patching should take no more than three seconds,<ref name="kernel_SCM_saga" /> and added three more points: |
||
− | * Take [[Concurrent Versions System]] (CVS) as an example of what ''not'' to do; if in doubt, make the exact opposite decision.<ref name="linusGoogleTalk" /> |
||
− | * Support a distributed, BitKeeper-like workflow.<ref name="linusGoogleTalk" /> |
||
− | * Include very strong safeguards against corruption, either accidental or malicious.<ref name="integrity_goals" /> |
||
+ | == Servers == |
||
− | These criteria eliminated every then-extant version-control system, so immediately after the 2.6.12-rc2 Linux kernel development release, Torvalds set out to write his own.<ref name="linusGoogleTalk" /> |
||
+ | {{Main|Eepsite/Services#Code}} |
||
+ | There are several Git services within I2P. |
||
− | The development of Git began on 3 April 2005.<ref name="selfhost">{{cite mailing list |url=https://marc.info/?l=git&m=117254154130732 |title=Re: Trivia: When did git self-host? |date=2007-02-27 |last=Torvalds |first=Linus |mailinglist=git}}</ref> Torvalds announced the project on 6 April;<ref>{{cite mailing list |url=https://marc.info/?l=linux-kernel&m=111280216717070 |title=Kernel SCM saga.. |date=2005-04-06 |last=Torvalds |first=Linus |mailinglist=linux-kernel}}</ref> it became [[Self-hosting (compilers)|self-hosting]] as of 7 April.<ref name="selfhost" /> The first merge of multiple branches took place on 18 April.<ref>{{cite mailing list |url=https://marc.info/?l=git&m=111377572329534 |title=First ever real kernel git merge! |date=2005-04-17 |last=Torvalds |first=Linus |mailinglist=git}}</ref> Torvalds achieved his performance goals; on 29 April, the nascent Git was benchmarked recording patches to the Linux kernel tree at the rate of 6.7 patches per second.<ref>{{cite mailing list |url=https://marc.info/?l=git&m=111475459526688 |title=Mercurial 0.4b vs git patchbomb benchmark |date=2005-04-29 |last=Mackall |first=Matt |mailinglist=git}}</ref> On 16 June Git managed the kernel 2.6.12 release.<ref>{{cite mailing list |url=https://marc.info/?l=git-commits-head&m=111904216911731 |title=Linux 2.6.12 |date=2005-06-17 |last=Torvalds |first=Linus |mailinglist=git-commits-head}}</ref> |
||
− | |||
− | Torvalds turned over [[software maintenance|maintenance]] on 26 July 2005 to Junio Hamano, a major contributor to the project.<ref>{{cite mailing list |url=https://marc.info/?l=git&m=112243466603239 |title=Meet the new maintainer... |date=2005-07-27 |last=Torvalds |first=Linus |mailinglist=git}}</ref> Hamano was responsible for the 1.0 release on 21 December 2005 and remains the project's maintainer.<ref>{{cite mailing list |url=https://marc.info/?l=git&m=113515203321888 |title=Announce: Git 1.0.0 |date=2005-12-21 |last=Hamano |first=Junio C. |mailinglist=git}}</ref> |
||
− | |||
− | ===Naming=== |
||
− | Torvalds sarcastically quipped about the name ''git'' (which means ''unpleasant person'' in [[British English]] slang): "I'm an egotistical bastard, and I name all my projects after myself. First '[[Linux kernel|Linux]]', now 'git'."<ref name="whythegitname">{{cite web |
||
− | | url = https://git.wiki.kernel.org/index.php/GitFaq#Why_the_.27Git.27_name.3F |
||
− | | title = GitFaq: Why the 'Git' name? |
||
− | | publisher = Git.or.cz |
||
− | | access-date = 2012-07-14 |
||
− | | url-status = live |
||
− | | archiveurl = https://web.archive.org/web/20120723224559/https://git.wiki.kernel.org/index.php/GitFaq#Why_the_.27Git.27_name.3F |
||
− | | archivedate = 23 July 2012 |
||
− | | df = dmy-all}}</ref><ref>{{cite web |url= http://www.pcworld.idg.com.au/article/129776/after_controversy_torvalds_begins_work_git_/ |title= After controversy, Torvalds begins work on 'git' |date= 2012-07-14 |publisher= PC World |quote= [[Torvalds]] seemed aware that his decision to drop BitKeeper would also be controversial. When asked why he called the new software, 'git', [[British English|British]] slang meaning 'a rotten person', he said. 'I'm an egotistical bastard, so I name all my projects after myself. First Linux, now git.' |url-status= live |archiveurl= https://web.archive.org/web/20110201184934/http://www.pcworld.idg.com.au/article/129776/after_controversy_torvalds_begins_work_git_/ |archivedate= 1 February 2011 |df= dmy-all}}</ref> The [[man page]] describes Git as "the stupid content tracker".<ref>{{cite web |url= https://git-scm.com/docs/git.html |title= git(1) Manual Page |access-date= 2012-07-21 |url-status= live |archiveurl= https://web.archive.org/web/20120621133627/http://www.git-scm.com/docs/git.html |archivedate= 21 June 2012 |df= dmy-all}}</ref> The read-me file of the source code elaborates further:<ref>{{cite web |title= Initial revision of 'git', the information manager from hell · git/git@e83c516 |url= https://github.com/git/git/blob/e83c5163316f89bfbde7d9ab23ca2e25604af290/README |website= GitHub |access-date= 2016-01-21 |url-status= live |archiveurl= https://web.archive.org/web/20171008211145/https://github.com/git/git/blob/e83c5163316f89bfbde7d9ab23ca2e25604af290/README |archivedate= 8 October 2017 |df= dmy-all}}</ref> |
||
− | |||
− | {{quote|The name "git" was given by Linus Torvalds when he wrote the very first version. He described the tool as "the stupid content tracker" and the name as (depending on your way): |
||
− | * random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant. |
||
− | * stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang. |
||
− | * "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room. |
||
− | * "goddamn idiotic truckload of sh*t": when it breaks |
||
− | }} |
||
− | |||
− | ===Releases=== |
||
− | List of Git releases:<ref>https://github.com/git/git/releases</ref> |
||
− | {| class="wikitable" |
||
− | |- |
||
− | ! Version |
||
− | ! Original release date |
||
− | ! Latest (patch) version |
||
− | ! Release date (of patch) |
||
− | |- |
||
− | | {{Version|o|0.99}} |
||
− | | 2005-07-11 |
||
− | | 0.99.9n |
||
− | | 2005-12-15 |
||
− | |- |
||
− | | {{Version|o|1.0}} |
||
− | | 2005-12-21 |
||
− | | 1.0.13 |
||
− | | 2006-01-27 |
||
− | |- |
||
− | | {{Version|o|1.1}} |
||
− | | 2006-01-08 |
||
− | | 1.1.6 |
||
− | | 2006-01-30 |
||
− | |- |
||
− | | {{Version|o|1.2}} |
||
− | | 2006-02-12 |
||
− | | 1.2.6 |
||
− | | 2006-04-08 |
||
− | |- |
||
− | | {{Version|o|1.3}} |
||
− | | 2006-04-18 |
||
− | | 1.3.3 |
||
− | | 2006-05-16 |
||
− | |- |
||
− | | {{Version|o|1.4}} |
||
− | | 2006-06-10 |
||
− | | 1.4.4.5 |
||
− | | 2008-07-16 |
||
− | |- |
||
− | | {{Version|o|1.5}} |
||
− | | 2007-02-14 |
||
− | | 1.5.6.6 |
||
− | | 2008-12-17 |
||
− | |- |
||
− | | {{Version|o|1.6}} |
||
− | | 2008-08-17 |
||
− | | 1.6.6.3 |
||
− | | 2010-12-15 |
||
− | |- |
||
− | | {{Version|o|1.7}} |
||
− | | 2010-02-13 |
||
− | | 1.7.12.4 |
||
− | | 2012-10-17 |
||
− | |- |
||
− | | {{Version|o|1.8}} |
||
− | | 2012-10-21 |
||
− | | 1.8.5.6 |
||
− | | 2014-12-17 |
||
− | |- |
||
− | | {{Version|o|1.9}} |
||
− | | 2014-02-14 |
||
− | | 1.9.5 |
||
− | | 2014-12-17 |
||
− | |- |
||
− | | {{Version|o|2.0}} |
||
− | | 2014-05-28 |
||
− | | 2.0.5 |
||
− | | 2014-12-17 |
||
− | |- |
||
− | | {{Version|o|2.1}} |
||
− | | 2014-08-16 |
||
− | | 2.1.4 |
||
− | | 2014-12-17 |
||
− | |- |
||
− | | {{Version|o|2.2}} |
||
− | | 2014-11-26 |
||
− | | 2.2.3 |
||
− | | 2015-09-04 |
||
− | |- |
||
− | | {{Version|o|2.3}} |
||
− | | 2015-02-05 |
||
− | | 2.3.10 |
||
− | | 2015-09-29 |
||
− | |- |
||
− | | {{Version|o|2.4}} |
||
− | | 2015-04-30 |
||
− | | 2.4.12 |
||
− | | 2017-05-05 |
||
− | |- |
||
− | | {{Version|o|2.5}} |
||
− | | 2015-07-27 |
||
− | | 2.5.6 |
||
− | | 2017-05-05 |
||
− | |- |
||
− | | {{Version|o|2.6}} |
||
− | | 2015-09-28 |
||
− | | 2.6.7 |
||
− | | 2017-05-05 |
||
− | |- |
||
− | | {{Version|o|2.7}} |
||
− | | 2015-10-04 |
||
− | | 2.7.6 |
||
− | | 2017-07-30 |
||
− | |- |
||
− | | {{Version|o|2.8}} |
||
− | | 2016-03-28 |
||
− | | 2.8.6 |
||
− | | 2017-07-30 |
||
− | |- |
||
− | | {{Version|o|2.9}} |
||
− | | 2016-06-13 |
||
− | | 2.9.5 |
||
− | | 2017-07-30 |
||
− | |- |
||
− | | {{Version|o|2.10}} |
||
− | | 2016-09-02 |
||
− | | 2.10.5 |
||
− | | 2017-09-22 |
||
− | |- |
||
− | | {{Version|o|2.11}} |
||
− | | 2016-11-29 |
||
− | | 2.11.4 |
||
− | | 2017-09-22 |
||
− | |- |
||
− | | {{Version|o|2.12}} |
||
− | | 2017-02-24 |
||
− | | 2.12.5 |
||
− | | 2017-09-22 |
||
− | |- |
||
− | | {{Version|o|2.13}} |
||
− | | 2017-05-10 |
||
− | | 2.13.7 |
||
− | | 2018-05-22 |
||
− | |- |
||
− | | {{Version|o|2.14}} |
||
− | | 2017-08-04 |
||
− | | 2.14.6 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.15}} |
||
− | | 2017-10-30 |
||
− | | 2.15.4 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.16}} |
||
− | | 2018-01-17 |
||
− | | 2.16.6 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.17}} |
||
− | | 2018-04-02 |
||
− | | 2.17.3 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.18}} |
||
− | | 2018-06-21 |
||
− | | 2.18.2 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.19}} |
||
− | | 2018-09-10 |
||
− | | 2.19.3 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.20}} |
||
− | | 2018-12-09 |
||
− | | 2.20.2 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|o|2.21}} |
||
− | | 2019-02-24 |
||
− | | 2.21.1 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|co|2.22}} |
||
− | | 2019-06-07 |
||
− | | 2.22.2 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|co|2.23}} |
||
− | | 2019-08-16 |
||
− | | 2.23.1 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|co|2.24}} |
||
− | | 2019-11-04 |
||
− | | 2.24.1 |
||
− | | 2019-12-07 |
||
− | |- |
||
− | | {{Version|c|2.25}} |
||
− | | 2020-01-13 |
||
− | | 2.25.0 |
||
− | | 2020-01-13 |
||
− | |- |
||
− | | colspan="4" | <small>{{Version |l |show=111110}}</small> |
||
− | |} |
||
− | <!-- o=Old-Not-Supported; co=Old-Still-Supported; c=Latest-Stable; --> |
||
− | Source:<ref>{{cite web |url=https://github.com/git/git |title=Git Github main page}}</ref><ref>{{cite web |url=https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt |title= How to maintain Git, Official Git documentation}}</ref> |
||
− | |||
− | ==Design== |
||
− | Git's design was inspired by [[BitKeeper]] and [[Monotone (software)|Monotone]].<ref>{{cite mailing list |mailinglist=linux-kernel |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=114685143200012 |title=Re: [ANNOUNCE] Git wiki |date=2006-05-05}} "Some historical background" on Git's predecessors</ref><ref name="a_quick_challenge">{{cite mailing list |last=Torvalds |first=Linus |url=https://marc.info/?l=linux-kernel&m=111293537202443 |title=Re: Kernel SCM saga |date=2005-04-08 |mailinglist=linux-kernel |accessdate=2008-02-20}}</ref> Git was originally designed as a low-level version-control system engine, on top of which others could write front ends, such as [[Cogito (software)|Cogito]] or [[StGIT]].<ref name="a_quick_challenge" /> The core Git project has since become a complete version-control system that is usable directly.<ref name="bare_url">{{cite mailing list |mailinglist=git |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=114314642000462 |title=Re: Errors GITtifying GCC and Binutils |date=2006-03-23}}</ref> While strongly influenced by BitKeeper, Torvalds deliberately avoided conventional approaches, leading to a unique design.<ref>{{cite mailing list |mailinglist=git |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=116129092117475 |title=Re: VCS comparison table |date=2006-10-20}} A discussion of Git vs. BitKeeper.</ref> |
||
− | |||
− | ===Characteristics=== |
||
− | Git's design is a synthesis of Torvalds's experience with Linux in maintaining a large distributed development project, along with his intimate knowledge of file system performance gained from the same project and the urgent need to produce a working system in short order. These influences led to the following implementation choices:{{citation needed | reason=the content is highly questionable and hence proper citation is required | date = February 2017}} |
||
− | ; Strong support for non-linear development: Git supports rapid branching and merging, and includes specific tools for visualizing and navigating a non-linear development history. In Git, a core assumption is that a change will be merged more often than it is written, as it is passed around to various reviewers. In Git, branches are very lightweight: a branch is only a reference to one commit. With its parental commits, the full branch structure can be constructed. |
||
− | ; Distributed development: Like [[Darcs]], [[BitKeeper]], [[Mercurial]], [[Bazaar (software)|Bazaar]], and [[Monotone (software)|Monotone]], Git gives each developer a local copy of the full development history, and changes are copied from one such repository to another. These changes are imported as added development branches and can be merged in the same way as a locally developed branch. |
||
− | ; Compatibility with existent systems and protocols: Repositories can be published via [[Hypertext Transfer Protocol]] (HTTP), [[File Transfer Protocol]] (FTP), or a Git protocol over either a plain socket, or [[Secure Shell]] (ssh). Git also has a CVS server emulation, which enables the use of existent CVS clients and IDE plugins to access Git repositories. [[Apache Subversion|Subversion]] repositories can be used directly with git-svn. |
||
− | ; Efficient handling of large projects: Torvalds has described Git as being very fast and scalable,<ref>{{cite mailing list |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=116128307511686 |title=Re: VCS comparison table |date=2006-10-19 |mailinglist=git}}</ref> and performance tests done by Mozilla<ref>Jst's Blog on Mozillazine {{cite web|title=bzr/hg/git performance |url=http://weblogs.mozillazine.org/jst/archives/2006/11/vcs_performance.html |accessdate=12 February 2015 |url-status=dead |archiveurl=https://web.archive.org/web/20100529094107/http://weblogs.mozillazine.org/jst/archives/2006/11/vcs_performance.html |archivedate=29 May 2010}}</ref> showed that it was an [[order of magnitude]] faster than some version-control systems; fetching version history from a locally stored repository can be one hundred times faster than fetching it from the remote server.<ref>{{cite web |last=Dreier |first=Roland |url=http://digitalvampire.org/blog/index.php/2006/11/16/oh-what-a-relief-it-is/ |title=Oh what a relief it is |date=2006-11-13 |url-status=live |archiveurl=https://web.archive.org/web/20090116175841/http://digitalvampire.org/blog/index.php/2006/11/16/oh-what-a-relief-it-is/ |archivedate=16 January 2009 |df=dmy-all}}, observing that "git log" is 100x faster than "svn log" because the latter must contact a remote server.</ref> |
||
− | ; Cryptographic authentication of history: The Git history is stored in such a way that the ID of a particular version (a ''commit'' in Git terms) depends upon the complete development history leading up to that commit. Once it is published, it is not possible to change the old versions without it being noticed. The structure is similar to a [[Merkle tree]], but with added data at the nodes and leaves.<ref>{{cite web |url=https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#trust |publisher=Git User's Manual |work=Git Concepts |title=Trust |date=2006-10-18 |url-status=live |archiveurl=https://web.archive.org/web/20170222053056/https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#trust |archivedate=22 February 2017 |df=dmy-all}}</ref> ([[Mercurial]] and [[Monotone (software)|Monotone]] also have this property.) |
||
− | ; Toolkit-based design: Git was designed as a set of programs written in [[C (programming language)|C]] and several shell scripts that provide wrappers around those programs.<ref>{{cite mailing list |mailinglist=git |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=116118369005954 |title=Re: VCS comparison table |accessdate=2009-04-10}}, describing Git's script-oriented design</ref> Although most of those scripts have since been rewritten in C for speed and portability, the design remains, and it is easy to chain the components together.<ref>{{cite web |author=iabervon |url=https://lwn.net/Articles/165202/ |title=Git rocks! |date=2005-12-22 |url-status=live |archiveurl=https://web.archive.org/web/20160914100946/https://lwn.net/Articles/165202/ |archivedate=14 September 2016 |df=dmy-all}}, praising Git's scriptability.</ref> |
||
− | ; Pluggable merge strategies: As part of its toolkit design, Git has a well-defined model of an incomplete merge, and it has multiple algorithms for completing it, culminating in telling the user that it is unable to complete the merge automatically and that manual editing is needed. |
||
− | ; [[Garbage (computer science)|Garbage]] accumulates until collected: Aborting operations or backing out changes will leave useless dangling objects in the database. These are generally a small fraction of the continuously growing history of wanted objects. Git will automatically perform [[garbage collection (computer science)|garbage collection]] when enough loose objects have been created in the repository. Garbage collection can be called explicitly using <code>git gc --prune</code>.<ref>{{cite web |url=https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#ensuring-reliability |title=Git User's Manual |date=2007-08-05 |url-status=live |archiveurl=https://web.archive.org/web/20170222053056/https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#ensuring-reliability |archivedate=22 February 2017 |df=dmy-all}}</ref> |
||
− | ; Periodic explicit object packing: Git stores each newly created object as a separate file. Although individually compressed, this takes a great deal of space and is inefficient. This is solved by the use of ''packs'' that store a large number of objects [[Delta encoding|delta-compressed]] among themselves in one file (or network byte stream) called a ''packfile''. Packs are compressed using the [[Heuristic (computer science)|heuristic]] that files with the same name are probably similar, without depending on this for correctness. A corresponding index file is created for each packfile, telling the offset of each object in the packfile. Newly created objects (with newly added history) are still stored as single objects, and periodic repacking is needed to maintain space efficiency. The process of packing the repository can be very computationally costly. By allowing objects to exist in the repository in a loose but quickly generated format, Git allows the costly pack operation to be deferred until later, when time matters less, e.g., the end of a work day. Git does periodic repacking automatically, but manual repacking is also possible with the <tt>git gc</tt> command. For data integrity, both the packfile and its index have an [[SHA-1]] checksum inside, and the file name of the packfile also contains an SHA-1 checksum. To check the integrity of a repository, run the <tt>git fsck</tt> command. |
||
− | |||
− | Another property of Git is that it snapshots directory trees of files. The earliest systems for tracking versions of source code, [[Source Code Control System]] (SCCS) and [[Revision Control System]] (RCS), worked on individual files and emphasized the space savings to be gained from [[interleaved deltas]] (SCCS) or [[delta encoding]] (RCS) the (mostly similar) versions. Later revision-control systems maintained this notion of a file having an identity across multiple revisions of a project. However, Torvalds rejected this concept.<ref>{{cite mailing list |mailinglist=linux-kernel |last=Torvalds |first=Linus |url=https://marc.info/?l=linux-kernel&m=111314792424707 |title=Re: more git updates.. |date=2005-04-10}}</ref> Consequently, Git does not explicitly record file revision relationships at any level below the source-code tree. |
||
− | |||
− | These implicit revision relationships have some significant consequences: |
||
− | * It is slightly more costly to examine the change history of one file than the whole project.<ref>{{cite mailing list |mailinglist=git |last=Haible |first=Bruno |url=https://marc.info/?l=git&m=117119479505638 |title=how to speed up "git log"? |date=2007-02-11}}</ref> To obtain a history of changes affecting a given file, Git must walk the global history and then determine whether each change modified that file. This method of examining history does, however, let Git produce with equal efficiency a single history showing the changes to an arbitrary set of files. For example, a subdirectory of the source tree plus an associated global header file is a very common case. |
||
− | * Renames are handled implicitly rather than explicitly. A common complaint with [[Concurrent Versions System|CVS]] is that it uses the name of a file to identify its revision history, so moving or renaming a file is not possible without either interrupting its history or renaming the history and thereby making the history inaccurate. Most post-CVS revision-control systems solve this by giving a file a unique long-lived name (analogous to an [[inode]] number) that survives renaming. Git does not record such an identifier, and this is claimed as an advantage.<ref>{{cite mailing list |mailinglist=git |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=114123702826251 |title=Re: impure renames / history tracking |date=2006-03-01}}</ref><ref>{{cite mailing list |mailinglist=git |last=Hamano |first=Junio C. |url=https://marc.info/?l=git&m=114316047119262 |title=Re: Errors GITtifying GCC and Binutils |date=2006-03-24}}</ref> [[Source code]] files are sometimes split or merged, or simply renamed,<ref>{{cite mailing list |mailinglist=git |last=Hamano |first=Junio C. |url=https://marc.info/?l=git&m=114315795227271 |title=Re: Errors GITtifying GCC and Binutils |date=2006-03-23}}</ref> and recording this as a simple rename would freeze an inaccurate description of what happened in the (immutable) history. Git addresses the issue by detecting renames while browsing the history of snapshots rather than recording it when making the snapshot.<ref>{{cite mailing list |mailinglist=git |last=Torvalds |first=Linus |url=https://marc.info/?l=git&m=116473016012824 |title=Re: git and bzr |date=2006-11-28}}, on using <code>git-blame</code> to show code moved between source files.</ref> (Briefly, given a file in revision ''N'', a file of the same name in revision ''N'' − 1 is its default ancestor. However, when there is no like-named file in revision ''N'' − 1, Git searches for a file that existed only in revision ''N'' − 1 and is very similar to the new file.) However, it does require more [[central processing unit|CPU]]-intensive work every time the history is reviewed, and several options to adjust the heuristics are available. This mechanism does not always work; sometimes a file that is renamed with changes in the same commit is read as a deletion of the old file and the creation of a new file. Developers can work around this limitation by committing the rename and the changes separately. |
||
− | |||
− | Git implements several merging strategies; a non-default strategy can be selected at merge time:<ref>{{cite web |last=Torvalds |first=Linus |url=https://www.kernel.org/pub/software/scm/git/docs/git-merge.html |title=git-merge(1) |date=2007-07-18 |url-status=live |archiveurl=https://web.archive.org/web/20160716100147/https://www.kernel.org/pub/software/scm/git/docs/git-merge.html |archivedate=16 July 2016 |df=dmy-all}}</ref> |
||
− | * ''resolve'': the traditional [[three-way merge]] algorithm. |
||
− | * ''recursive'': This is the default when pulling or merging one branch, and is a variant of the three-way merge algorithm. {{quote|When there are more than one common ancestors that can be used for three-way merge, it creates a merged tree of the common ancestors and uses that as the reference tree for the three-way merge. This has been reported to result in fewer merge conflicts without causing mis-merges by tests done on prior merge commits taken from Linux 2.6 kernel development history. Also, this can detect and handle merges involving renames.|Linus Torvalds<ref>{{cite web |last=Torvalds |first=Linus |url=http://revctrl.org/CrissCrossMerge |title=CrissCrossMerge |date=2007-07-18 |url-status=dead |archiveurl=https://web.archive.org/web/20060113122252/http://revctrl.org/CrissCrossMerge |archivedate=13 January 2006 |df=dmy-all}}</ref>}} |
||
− | * ''octopus'': This is the default when merging more than two heads. |
||
− | |||
− | ===Data structures=== |
||
− | Git's primitives are not inherently a [[Source control management|source-code management]] system. Torvalds explains:<ref>{{cite mailing list |mailinglist=linux-kernel |last=Torvalds |first=Linus |url=https://marc.info/?l=linux-kernel&m=111314792424707 |title=Re: more git updates... |date=2005-04-10}}</ref> |
||
− | {{quote|In many ways you can just see git as a filesystem{{snd}} it's [[Content-addressable storage|content-addressable]], and it has a notion of versioning, but I really designed it coming at the problem from the viewpoint of a ''filesystem'' person (hey, kernels is what I do), and I actually have absolutely ''zero'' interest in creating a traditional SCM system.}} |
||
− | |||
− | From this initial design approach, Git has developed the full set of features expected of a traditional SCM,<ref name="bare_url" /> with features mostly being created as needed, then refined and extended over time. |
||
− | |||
− | [[File:Git operations.svg|thumb|Some data flows and storage levels in the Git revision control system]] |
||
− | |||
− | Git has two [[data structure]]s: a mutable ''index'' (also called ''stage'' or ''cache'') that caches information about the working directory and the next revision to be committed; and an immutable, append-only ''object database''. |
||
− | |||
− | The index serves as connection point between the object database and the working tree. |
||
− | |||
− | The object database contains four types of objects: |
||
− | * A ''blob'' ([[binary large object]]) is the content of a [[computer file|file]]. Blobs have no proper file name, time stamps, or other metadata. (A blob's name internally is a hash of its content.) |
||
− | * A ''tree'' object is the equivalent of a directory. It contains a list of file names, each with some type bits and a reference to a blob or tree object that is that file, symbolic link, or directory's contents. These objects are a snapshot of the source tree. (In whole, this comprises a [[Merkle tree]], meaning that only a single hash for the root tree is sufficient and actually used in commits to precisely pinpoint to the exact state of whole tree structures of any number of sub-directories and files.) |
||
− | * A ''commit'' object links tree objects together into a history. It contains the name of a tree object (of the top-level source directory), a time stamp, a log message, and the names of zero or more parent commit objects. |
||
− | * A ''tag'' object is a container that contains a reference to another object and can hold added meta-data related to another object. Most commonly, it is used to store a [[digital signature]] of a commit object corresponding to a particular release of the data being tracked by Git. |
||
− | |||
− | Each object is identified by a SHA-1 [[Cryptographic hash function|hash]] of its contents. Git computes the hash and uses this value for the object's name. The object is put into a directory matching the first two characters of its hash. The rest of the hash is used as the file name for that object. |
||
− | |||
− | Git stores each revision of a file as a unique blob. The relationships between the blobs can be found through examining the tree and commit objects. Newly added objects are stored in their entirety using [[zlib]] compression. This can consume a large amount of disk space quickly, so objects can be combined into ''packs'', which use [[Delta encoding|delta compression]] to save space, storing blobs as their changes relative to other blobs. |
||
− | |||
− | ===References=== |
||
− | Every object in the Git database that is not referred to may be cleaned up by using a garbage collection command or automatically. An object may be referenced by another object or an explicit reference. Git knows different types of references. The commands to create, move, and delete references vary. "git show-ref" lists all references. Some types are: |
||
− | * ''heads'': refers to an object locally, |
||
− | * ''remotes'': refers to an object which exists in a remote repository, |
||
− | * ''stash'': refers to an object not yet committed, |
||
− | * ''meta'': e.g. a configuration in a bare repository, user rights; the refs/meta/config namespace was introduced retrospectively, gets used by [[Gerrit (software)|Gerrit]],<ref>[https://gerrit-review.googlesource.com/Documentation/config-project-config.html Gerrit Code Review – Project Configuration File Format].</ref> |
||
− | * ''tags'': see above. |
||
− | |||
− | ==Implementations== |
||
− | [[File:GNOME gitg.png|thumb|[[GNOME Core Applications|gitg]] is a graphical front-end using [[GTK+]]]] |
||
− | |||
− | Git is primarily developed on [[Linux]], although it also supports most major operating systems, including [[Berkeley Software Distribution|BSD]], [[Solaris (operating system)|Solaris]], [[macOS]], and [[Microsoft Windows|Windows]].<ref>{{cite web |url=https://git-scm.com/downloads |accessdate=14 May 2012 |title=downloads |url-status=live |archiveurl=https://web.archive.org/web/20120508021315/http://git-scm.com/downloads |archivedate=8 May 2012 |df=dmy-all}}</ref> |
||
− | |||
− | The first Windows [[porting|port]] of Git was primarily a Linux-emulation framework that hosts the Linux version. Installing Git under Windows creates a similarly named Program Files directory containing the [[MinGW]] port of the [[GNU Compiler Collection]], [[Perl]] 5, msys2.0 (itself a fork of [[Cygwin]], a Unix-like emulation environment for Windows) and various other Windows ports or emulations of Linux utilities and libraries. Currently native Windows builds of Git are distributed as 32- and 64-bit installers.<ref>{{cite web |url=https://github.com/msysgit/msysgit|accessdate=20 Sep 2016 |title=msysGit |url-status=live |archiveurl=https://web.archive.org/web/20161010143600/https://github.com/msysgit/msysgit |archivedate=10 October 2016 |df=dmy-all}}</ref> |
||
− | |||
− | The JGit implementation of Git is a pure [[Java (software platform)|Java]] software library, designed to be embedded in any Java application. JGit is used in the [[Gerrit (software)|Gerrit]] code-review tool and in EGit, a Git client for the [[Eclipse (software)|Eclipse]] IDE.<ref>{{cite web |url=https://www.eclipse.org/jgit/ |accessdate=24 Aug 2012 |title=JGit |url-status=live |archiveurl=https://web.archive.org/web/20120831201256/http://eclipse.org/jgit/ |archivedate=31 August 2012 |df=dmy-all}}</ref> |
||
− | |||
− | go-git is an [[Open-source software|open-source]] implementation of Git written in pure [[Go (programming language)|Go]].<ref>{{cite web|url=https://git-scm.com/book/en/v2/Appendix-B%3A-Embedding-Git-in-your-Applications-go-git|title=Git - go-git|website=git-scm.com|access-date=2019-04-19}}</ref> It is currently used for backing projects as a [[SQL]] interface for Git code repositories<ref>{{citation|title=SQL interface to Git repositories, written in Go.|url=https://github.com/src-d/gitbase|website=github.com|access-date=2019-04-19}}</ref> and providing [[encryption]] for Git.<ref>{{cite web|url=https://keybase.io/blog/encrypted-git-for-everyone|title=Keybase launches encrypted git|website=keybase.io|access-date=2019-04-19}}</ref> |
||
− | |||
− | The Dulwich implementation of Git is a pure [[Python (programming language)|Python]] software component for Python 2.7, 3.4 and 3.5<ref>{{cite web |url=https://www.samba.org/~jelmer/dulwich/ |accessdate=27 Aug 2012 |title=Dulwich |url-status=live |archiveurl=https://web.archive.org/web/20120529053253/http://www.samba.org/~jelmer/dulwich/ |archivedate=29 May 2012 |df=dmy-all}}</ref> |
||
− | |||
− | The libgit2 implementation of Git is an ANSI C software library with no other dependencies, which can be built on multiple platforms, including Windows, Linux, macOS, and BSD.<ref>{{cite web |url=https://github.com/libgit2/libgit2/blob/master/README.md |accessdate=24 Aug 2012 |title=libgit2 |url-status=live |archiveurl=https://web.archive.org/web/20160411135623/https://github.com/libgit2/libgit2/blob/master/README.md |archivedate=11 April 2016 |df=dmy-all}}</ref> It has bindings for many programming languages, including [[Ruby (programming language)|Ruby]], Python, and [[Haskell (programming language)|Haskell]].<ref>{{cite web |url=https://github.com/libgit2/rugged |accessdate=24 Aug 2012 |title=rugged |url-status=live |archiveurl=https://web.archive.org/web/20130724042431/https://github.com/libgit2/rugged |archivedate=24 July 2013 |df=dmy-all}}</ref><ref>{{cite web |url=https://github.com/libgit2/pygit2 |accessdate=24 Aug 2012 |title=pygit2 |url-status=live |archiveurl=https://web.archive.org/web/20150805001221/https://github.com/libgit2/pygit2 |archivedate=5 August 2015 |df=dmy-all}}</ref><ref>{{cite web |url=https://hackage.haskell.org/package/hlibgit2 |accessdate=30 Apr 2013 |title=hlibgit2 |url-status=live |archiveurl=https://web.archive.org/web/20130525064750/http://hackage.haskell.org/package/hlibgit2 |archivedate=25 May 2013 |df=dmy-all}}</ref> |
||
− | |||
− | JS-Git is a [[JavaScript]] implementation of a subset of Git.<ref>{{cite web |url=https://github.com/creationix/js-git |title=js-git: a JavaScript implementation of Git |accessdate=2013-08-13 |url-status=live |archiveurl=https://web.archive.org/web/20130807173550/https://github.com/creationix/js-git |archivedate=7 August 2013 |df=dmy-all}}</ref> |
||
− | |||
− | ==Git GUIs== |
||
− | {{See also|Comparison of Git GUIs}} |
||
− | |||
− | ==Git server== |
||
− | [[File:Gitweb.png|thumb|Screenshot of Gitweb interface showing a commit [[diff]]]] |
||
− | |||
− | As Git is a distributed version-control system, it could be used as a server out of the box. It's shipped with built-in command <code>git daemon</code> which starts simple TCP server running on the GIT protocol.<ref>{{cite web|url=https://git-scm.com/book/en/v2/Git-on-the-Server-Git-Daemon|title=Git - Git Daemon|website=git-scm.com|access-date=2019-07-10}}</ref> Dedicated Git HTTP servers help (amongst other features) by adding access control, displaying the contents of a Git repository via the web interfaces, and managing multiple repositories. Already existing Git repositories can be cloned and shared to be used by others as a centralized repo. It can also be accessed via remote shell just by having the Git software installed and allowing a user to log in.<ref>[https://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server 4.4 Git on the Server – Setting Up the Server] {{webarchive|url=https://web.archive.org/web/20141022015944/http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server |date=22 October 2014}}, Pro Git.</ref> Git servers typically listen on [[TCP and UDP port|TCP port]] 9418.<ref>{{cite web |url=https://git-scm.com/book/ch4-1.html#The-Git-Protocol |title=1.4 Getting Started – Installing Git |publisher=git-scm.com |accessdate=2013-11-01 |url-status=live |archiveurl=https://web.archive.org/web/20131102192025/http://git-scm.com/book/ch4-1.html#The-Git-Protocol |archivedate=2 November 2013 |df=dmy-all}}</ref> |
||
− | |||
− | ===Open source=== |
||
− | * Hosting the Git server using the Git Binary.<ref>https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server</ref> |
||
− | * [[Gerrit (software)|Gerrit]], a git server configurable to support code reviews and providing access via ssh, an integrated [[Apache MINA]] or OpenSSH, or an integrated [[Jetty (web server)|Jetty]] web server. Gerrit provides integration for LDAP, Active Directory, OpenID, OAuth, Kerberos/GSSAPI, X509 https client certificates. With Gerrit 3.0 all configurations will be stored as git repositories, no database required to run. Gerrit has a pull-request feature implemented in its core but lacks a GUI for it. |
||
− | * [[Phabricator]], a spin-off from Facebook. As Facebook primarily uses [[Mercurial]], the git support is not as prominent.<ref>[https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/ Diffusion User Guide: Repository Hosting].</ref> |
||
− | * [[Trac]], supporting git, [[Mercurial]], and [[Apache Subversion|Subversion]] with a [[modified BSD license]]. |
||
− | * [[RhodeCode]] Community Edition (CE), supporting git, [[Mercurial]] and [[Apache Subversion|Subversion]] with an [[AGPLv3|AGPLv3 license]]. |
||
− | * [[Kallithea (software)|Kallithea]], supporting both git and [[Mercurial]], developed in [[Python (programming language)|Python]] with [[GPL license]]. |
||
− | * External projects like gitolite,<ref>https://gitolite.com/gitolite/index.html</ref> which provide scripts on top of git software to provide fine-grained access control. |
||
− | * There are several other FLOSS solutions for self-hosting, including Gogs<ref>https://gogs.io/</ref> and [[Gitea]], a fork of Gogs, both developed in [[Go (programming language)|Go language]] with [[MIT license]]. |
||
− | |||
− | ===As service=== |
||
− | {{See also|Comparison of source code hosting facilities}} |
||
− | |||
− | Best known are probably [[GitHub]] and [[Bitbucket]] offerings, but many others are available, like [[GitLab]], [[Gitea]], GerritForge, etc. |
||
− | |||
− | ==Adoption== |
||
− | The [[Eclipse Foundation]] reported in its annual community survey that as of May 2014, Git is now the most widely used source-code management tool, with 42.9% of professional software developers reporting that they use Git as their primary source-control system<ref name="ianskerrett.wordpress.com">{{cite web |url=https://ianskerrett.wordpress.com/2014/06/23/eclipse-community-survey-2014-results/ |title=Eclipse Community Survey 2014 results | Ian Skerrett |publisher=Ianskerrett.wordpress.com |date=2014-06-23 |accessdate=2014-06-23 |url-status=live |archiveurl=https://web.archive.org/web/20140625152145/http://ianskerrett.wordpress.com/2014/06/23/eclipse-community-survey-2014-results/ |archivedate=25 June 2014 |df=dmy-all}}</ref> compared with 36.3% in 2013, 32% in 2012; or for Git responses excluding use of [[GitHub]]: 33.3% in 2014, 30.3% in 2013, 27.6% in 2012 and 12.8% in 2011.<ref>{{cite web |url=https://eclipse.org/org/community_survey/Survey_Final_Results_2012.xls |title=Results of Eclipse Community Survey 2012 |url-status=live |archiveurl=https://web.archive.org/web/20160411135719/http://www.eclipse.org/org/community_survey/Survey_Final_Results_2012.xls |archivedate=11 April 2016 |df=dmy-all}}</ref> Open-source directory [[Black Duck Open Hub]] reports a similar uptake among open-source projects.<ref>{{cite web |url=https://www.openhub.net/repositories/compare |title=Compare Repositories – Open Hub |url-status=live |archiveurl=https://web.archive.org/web/20140907051024/https://www.openhub.net/repositories/compare |archivedate=7 September 2014 |df=dmy-all}}</ref> |
||
− | |||
− | [[Stack Overflow]] has included [[Version control]] in their annual developer survey<ref>{{cite web | url=https://insights.stackoverflow.com/survey | title=Stack Overflow Annual Developer Survey | publisher=Stack Exchange, Inc. | accessdate=9 January 2020 | quote=Stack Overflow’s annual Developer Survey is the largest and most comprehensive survey of people who code around the world. Each year, we field a survey covering everything from developers’ favorite technologies to their job preferences. This year marks the ninth year we’ve published our annual Developer Survey results, and nearly 90,000 developers took the 20-minute survey earlier this year.}}</ref> in 2015 (16,694 responses),<ref>{{cite web |title=Stack Overflow Developer Survey 2015 |url=https://insights.stackoverflow.com/survey/2015#tech-sourcecontrol |publisher=Stack Overflow |accessdate=29 May 2019 |url-status=dead |archiveurl=https://web.archive.org/web/20190504144447/https://insights.stackoverflow.com/survey/2015#tech-sourcecontrol |archivedate=4 May 2019 |df=dmy-all}}</ref> 2017 (30,730 responses)<ref>{{cite web |title=Stack Overflow Developer Survey 2017 |url=https://insights.stackoverflow.com/survey/2017#work-_-version-control |publisher=Stack Overflow |accessdate=29 May 2019 |url-status=dead |archiveurl=https://web.archive.org/web/20190529004901/https://insights.stackoverflow.com/survey/2017#work-_-version-control |archivedate=29 May 2019 |df=dmy-all}}</ref> and 2018 (74,298 responses).<ref>{{cite web |title=Stack Overflow Developer Survey 2018 |url=https://insights.stackoverflow.com/survey/2018#work-_-version-control |publisher=Stack Overflow |accessdate=29 May 2019 |url-status=dead |archiveurl=https://web.archive.org/web/20190530142357/https://insights.stackoverflow.com/survey/2018/#work-_-version-control |archivedate=30 May 2019 |df=dmy-all}}</ref> Git was the overwhelming favorite of responding developers in these surveys, reporting as high as 87.2% in 2018. |
||
− | |||
− | Version control systems used by responding developers: |
||
{| class="wikitable sortable" |
{| class="wikitable sortable" |
||
+ | ! Name |
||
+ | ! AH/B32 |
||
+ | ! Description |
||
|- |
|- |
||
+ | | git.idk.i2p |
||
− | ! Name !! 2015 !! 2017 !! 2018 |
||
+ | | [http://git.idk.i2p/?i2paddresshelper=80oPWkYFSfbnZvb~9uDtoFvmchhH4CJ1qDmFfXvp-PtEFS8gIaUmN2d4eLiS8NGt-LS-kfJvyiezxUEjK1myFR2C~IIvY~UwPiIe2d2d-VrkFg3dt2FA2qGnf7YBDsgSby~TMjNREyL9lvNznlPu00E1bUpMS09l6llQ7f-xTYloQQzasmR3xTXLe4XEDAhXfGC-KsOhLVhT2BlTHNU0cTaxtZP50K-2grAi~xwA7bUp5Br9TQvdBNyWH1fbzZax50ooPxwdW6wdC3eMbI7qHCiEtF0pexTQ-2~BbALNoFU6HRXoYZwaYNwuDsPSo0XsguUJXOa6eQT90bXkbStqwPrA6p0WvRHUb3wgLug-s7FY~4ncz3lKPOX~zX-adCvXpYgHFgiJas-9i9KyaniNa0SWUEozOaah3TtAdXGRpufUlPm~jwBdFD2kYj~xgI5FGcBxA1OVyTwuWQRmisjf-1eJfsItr1944TKCu2kwgCTsBwX4Lu48ojjKqInpLV61BQAEAAcAAA== AH] [http://7qeve4v2chmjdqlwpa3vl7aojf3nodbku7vepnjwrsxljzqipz6a.b32.i2p/ B32] |
||
+ | | idk's GitLab service, hosts I2P's code |
||
|- |
|- |
||
+ | | git.community.i2p |
||
− | | Git || 69.3% || 69.2% || 87.2% |
||
+ | | [http://git.community.i2p/?i2paddresshelper=KvtrmFAzrOald4YcR8-q0YMiuSViFQniYoiu3H4fmd6zEfNo6OSTNQxfWivrEaOuPYnvgWMooGcaZmOQTqkrU8RFSMFcnQfVTwbmKoxFJp-I4WFp6HbptnKf6AkyR06Zk9DtCoAyEzqZtsoRbi8HbPBq09qAVGyGO6K-XiPp1wqIuCM-R4h82QdNvzkAat9WaIPqSLo2DiaWxf9JNmJN4-gDNR0WGGj2OFVQPrt-UKqDLyHwDQHqqkYA87Ch6yLJCeuBY6w9XVqrqHubB3utuU8cU6f3JuHEkbfqkfe2sKxgNnwRy2Clyw6AXkDvamYVpt07qV7ZhLy46kqhW-9g~Es-B3puRiu48AHiUhNMpzgwFS-r1R95gIDCGlIpJ18hf2UyYmQYayZL7IICnkjWd7SJL6G6MMrt-dRt3uKzkN6c635SyyG-XhPx3sWgWTHoNWZYgvT7jgViGBYhOJkGLNG5jWwKZLbx6DVOgAgwMnbZQ4VaSE~RT8cADnvsnxOlBQAEAAcAAA== AH] [http://giteabolfdejtdzblkooalqei6jr67imiugmhtsh6ocw4hlj5a4q.b32.i2p/ B32] |
||
− | |- |
||
+ | | Gitea based Git hosting |
||
− | | [[Apache Subversion|Subversion]] || 36.9% || 9.1% || 16.1% |
||
− | |- |
||
− | | Microsoft [[Team Foundation Server]] || 12.2% || 7.3% || 10.9% |
||
− | |- |
||
− | | [[Mercurial]] || 7.9% || 1.9% || 3.6% |
||
− | |- |
||
− | | [[Concurrent Versions System|CVS]] || 4.2% || {{efn-lr|name=fn0|Not listed as an option in this survey}} || {{efn-lr|name=fn0}} |
||
− | |- |
||
− | | [[Perforce]] || 3.3% || {{efn-lr|name=fn0}} || {{efn-lr|name=fn0}} |
||
− | |- |
||
− | | [[Microsoft Visual SourceSafe]] || {{efn-lr|name=fn0}} || 0.6% || {{efn-lr|name=fn0}} |
||
− | |- |
||
− | | [[Rational ClearCase]] || {{efn-lr|name=fn0}} || 0.4% || {{efn-lr|name=fn0}} |
||
− | |- |
||
− | | Zip file backups || {{efn-lr|name=fn0}} || 2.0% || 7.9% |
||
− | |- |
||
− | | Copying and pasting files to network shares || {{efn-lr|name=fn0}} || 1.7% || 7.9% |
||
− | |- |
||
− | | Other || 5.8% || 3.0% || {{efn-lr|name=fn0}} |
||
− | |- |
||
− | | None || 9.3% || 4.8% || 4.8% |
||
|} |
|} |
||
+ | == Setup guides == |
||
− | The UK IT jobs website itjobswatch.co.uk reports that as of late September 2016, 29.27% of UK permanent software development job openings have cited Git,<ref>{{cite web |url=https://www.itjobswatch.co.uk/jobs/uk/git%20%28software%29.do |title=Git (software) Jobs, Average Salary for Git Distributed Version Control System Skills |publisher=Itjobswatch.co.uk |accessdate=2016-09-30 |url-status=live |archiveurl=https://web.archive.org/web/20161008072321/http://www.itjobswatch.co.uk/jobs/uk/git%20(software).do |archivedate=8 October 2016 |df=dmy-all}}</ref> ahead of 12.17% for Microsoft [[Team Foundation Server]],<ref>{{cite web |url=https://www.itjobswatch.co.uk/jobs/uk/team%20foundation%20server.do |title=Team Foundation Server Jobs, Average Salary for Microsoft Team Foundation Server (TFS) Skills |publisher=Itjobswatch.co.uk |accessdate=2016-09-30 |url-status=live |archiveurl=https://web.archive.org/web/20161029185314/http://www.itjobswatch.co.uk/jobs/uk/team%20foundation%20server.do |archivedate=29 October 2016 |df=dmy-all}}</ref> 10.60% for [[Apache Subversion|Subversion]],<ref>{{cite web |url=https://www.itjobswatch.co.uk/jobs/uk/subversion.do |title=Subversion Jobs, Average Salary for Apache Subversion (SVN) Skills |publisher=Itjobswatch.co.uk |accessdate=2016-09-30 |url-status=live |archiveurl=https://web.archive.org/web/20161025011418/http://www.itjobswatch.co.uk/jobs/uk/subversion.do |archivedate=25 October 2016 |df=dmy-all}}</ref> 1.30% for [[Mercurial]],<ref>{{cite web |url=https://www.itjobswatch.co.uk/jobs/uk/mercurial.do |title=Mercurial Jobs, Average Salary for Mercurial Skills |publisher=Itjobswatch.co.uk |accessdate=2016-09-30 |url-status=live |archiveurl=https://web.archive.org/web/20160923081538/http://www.itjobswatch.co.uk/jobs/uk/mercurial.do |archivedate=23 September 2016 |df=dmy-all}}</ref> and 0.48% for [[Visual SourceSafe]].<ref>{{cite web |url=https://www.itjobswatch.co.uk/jobs/uk/vss/sourcesafe.do |title=VSS/SourceSafe Jobs, Average Salary for Microsoft Visual SourceSafe (VSS) Skills |publisher=Itjobswatch.co.uk |accessdate=2016-09-30 |url-status=live |archiveurl=https://web.archive.org/web/20161029043610/http://www.itjobswatch.co.uk/jobs/uk/vss/sourcesafe.do |archivedate=29 October 2016 |df=dmy-all}}</ref> |
||
− | |||
− | ===Extensions=== |
||
− | There are many ''Git extensions'', like [https://github.com/git-lfs/git-lfs Git LFS], which started as an extension to Git in the GitHub community and now is widely used by other repositories. Extensions are usually independently developed and maintained by different people, but in some point in the future a widely used extension can be merged to Git. |
||
− | |||
− | Microsoft developed the [[Virtual File System for Git]] (VFS for Git; formerly Git Virtual File System or GVFS) extension to handle the size of the [[Microsoft Windows|Windows]] source-code tree as part of their 2017 migration from [[Perforce]]. VFS for Git allows cloned repositories to use placeholders whose contents are downloaded only once a file is accessed.<ref name="ars-windowsgit">{{cite web |title=Windows switch to Git almost complete: 8,500 commits and 1,760 builds each day |url=https://arstechnica.com/information-technology/2017/05/90-of-windows-devs-now-using-git-creating-1760-windows-builds-per-day/ |website=Ars Technica |accessdate=24 May 2017 |url-status=live |archiveurl=https://web.archive.org/web/20170524171707/https://arstechnica.com/information-technology/2017/05/90-of-windows-devs-now-using-git-creating-1760-windows-builds-per-day/ |archivedate=24 May 2017 |df=dmy-all}}</ref> |
||
− | |||
− | ==Security== |
||
− | Git does not provide access-control mechanisms, but was designed for operation with other tools that specialize in access control.<ref>{{cite web |url=https://wincent.com/wiki/git_repository_access_control |title=Archived copy |accessdate=2016-09-06 |url-status=live |archiveurl=https://web.archive.org/web/20160914114143/https://wincent.com/wiki/git_repository_access_control |archivedate=14 September 2016 |df=dmy-all}}</ref> |
||
− | |||
− | On 17 December 2014, an exploit was found affecting the [[Microsoft Windows|Windows]] and [[macOS]] versions of the Git client. An attacker could perform [[arbitrary code execution]] on a target computer with Git installed by creating a malicious Git tree (directory) named ''.git'' (a directory in Git repositories that stores all the data of the repository) in a different case (such as .GIT or .Git, needed because Git does not allow the all-lowercase version of ''.git'' to be created manually) with malicious files in the ''.git/hooks'' subdirectory (a folder with executable files that Git runs) on a repository that the attacker made or on a repository that the attacker can modify. If a Windows or Mac user ''pulls'' (downloads) a version of the repository with the malicious directory, then switches to that directory, the .git directory will be overwritten (due to the case-insensitive trait of the Windows and Mac filesystems) and the malicious executable files in ''.git/hooks'' may be run, which results in the attacker's commands being executed. An attacker could also modify the ''.git/config'' configuration file, which allows the attacker to create malicious Git aliases (aliases for Git commands or external commands) or modify extant aliases to execute malicious commands when run. The vulnerability was patched in version 2.2.1 of Git, released on 17 December 2014, and announced the next day.<ref>{{cite web |url= https://developer.atlassian.com/blog/2014/12/securing-your-git-server/ |title= Securing your Git server against CVE-2014-9390 |date= 20 December 2014 |accessdate= 22 December 2014 |last= Pettersen |first= Tim |url-status= live |archiveurl= https://web.archive.org/web/20141224012942/https://developer.atlassian.com/blog/2014/12/securing-your-git-server/ |archivedate= 24 December 2014 |df= dmy-all}}</ref><ref>{{cite newsgroup |title=[Announce] Git v2.2.1 (and updates to older maintenance tracks) |author= Hamano, J. C.|date= 18 December 2014|newsgroup=gmane.linux.kernel |url=https://article.gmane.org/gmane.linux.kernel/1853266 |archive-url=https://web.archive.org/web/20141219024646/http://article.gmane.org/gmane.linux.kernel/1853266 |url-status=dead |archive-date=19 December 2014 |access-date=22 December 2014}}</ref> |
||
− | |||
− | Git version 2.6.1, released on 29 September 2015, contained a patch for a security vulnerability (CVE-2015-7545)<ref>{{cite web |url=https://people.canonical.com/~ubuntu-security/cve/2015/CVE-2015-7545.html |title=CVE-2015-7545 |date=15 December 2015 |accessdate=26 December 2015 |url-status=live |archiveurl=https://web.archive.org/web/20151226232616/http://people.canonical.com/~ubuntu-security/cve/2015/CVE-2015-7545.html |archivedate=26 December 2015 |df=dmy-all}}</ref> that allowed arbitrary code execution.<ref name="git-v2.6.1-commit">{{cite web |url=https://github.com/git/git/commit/22f698cb188243b313e024d618283e0293e37140 |title=Git 2.6.1 |accessdate=26 December 2015 |date=29 September 2015 |url-status=live |archiveurl=https://web.archive.org/web/20160411135802/https://github.com/git/git/commit/22f698cb188243b313e024d618283e0293e37140 |archivedate=11 April 2016 |df=dmy-all}}</ref> The vulnerability was exploitable if an attacker could convince a victim to clone a specific URL, as the arbitrary commands were embedded in the URL itself.<ref name="seclists-CVE-2015-7545">{{cite web |url=http://seclists.org/oss-sec/2015/q4/67 |title=Re: CVE Request: git |author=Blake Burkhart |accessdate=26 December 2015 |date=5 October 2015 |display-authors=etal |url-status=live |archiveurl=https://web.archive.org/web/20151227054727/http://seclists.org/oss-sec/2015/q4/67 |archivedate=27 December 2015 |df=dmy-all}}</ref> An attacker could use the exploit via a [[man-in-the-middle attack]] if the connection was unencrypted,<ref name="seclists-CVE-2015-7545" /> as they could redirect the user to a URL of their choice. Recursive clones were also vulnerable, since they allowed the controller of a repository to specify arbitrary URLs via the gitmodules file.<ref name="seclists-CVE-2015-7545" /> |
||
− | |||
− | Git uses [[SHA-1]] hashes internally. Linus Torvalds has responded that the hash was mostly to guard against accidental corruption, and the security a [[Cryptographic hash function|cryptographically secure hash]] gives was just an accidental side effect, with the main security being signing elsewhere.<ref>{{cite web |url=https://security.stackexchange.com/questions/67920/how-safe-are-signed-git-tags-only-as-safe-as-sha-1-or-somehow-safer |title=hash - How safe are signed git tags? Only as safe as SHA-1 or somehow safer? |publisher=Information Security Stack Exchange |date=September 22, 2014 |url-status=live |archiveurl=https://web.archive.org/web/20160624232415/https://security.stackexchange.com/questions/67920/how-safe-are-signed-git-tags-only-as-safe-as-sha-1-or-somehow-safer |archivedate=24 June 2016 |df=dmy-all}}</ref><ref>{{cite web |url=https://stackoverflow.com/questions/28792784/why-does-git-use-a-cryptographic-hash-function |title=Why does Git use a cryptographic hash function? |publisher=Stack Overflow |date=March 1, 2015 |url-status=live |archiveurl=https://web.archive.org/web/20160701214638/http://stackoverflow.com/questions/28792784/why-does-git-use-a-cryptographic-hash-function |archivedate=1 July 2016 |df=dmy-all}}</ref> |
||
− | |||
− | ==See also== |
||
− | {{Portal|Free and open-source software|Linux|Internet}} |
||
− | * [[Comparison of version control software]] |
||
− | * [[Comparison of source code hosting facilities]] |
||
− | * [[List of revision control software]] |
||
+ | * In-Network: http://i2p-projekt.i2p/en/docs/applications/git - Git over I2P for users |
||
− | ==Notes== |
||
+ | * Clearnet: https://geti2p.net/en/docs/applications/git - Git over I2P for users |
||
− | {{Notelist-lr}} |
||
− | ==References== |
+ | == References == |
+ | <references /> |
||
− | {{Reflist|30em}} |
||
− | ==External links== |
+ | == External links == |
− | {{Commons category|Git}} |
||
− | {{Wikibooks|Git}} |
||
− | * {{Official website}} |
||
− | * {{openhub|git|Git}} |
||
+ | * [https://en.wikipedia.org/wiki/Git Wikipedia article of Git (clearnet)] |
||
− | {{Revision control software}} |
||
+ | * [https://git-scm.com/ Home page of Git (clearnet)] |
||
− | {{Authority control}} |
||
− | [[Category: |
+ | [[Category:I2P]] |
− | [[Category:Concurrent Versions System| ]] |
||
− | [[Category:Distributed version control systems]] |
||
− | [[Category:Free version control software]] |
||
− | [[Category:Free software programmed in C]] |
||
− | [[Category:Free software programmed in Perl]] |
||
− | [[Category:Git (software)| ]] |
||
− | [[Category:Self-hosting software]] |
||
− | [[Category:Linus Torvalds]] |
||
− | [[Category:Software using the GPL license]] |
||
− | [[Category:Software that uses Tk]] |
Latest revision as of 22:46, 14 May 2024
Git is a version control system used by I2P, replacing the previous system Monotone in late 2020.[1]
Usage & tips
Telling Git to use I2P
To use HTTP/Git-based I2P servers, Git's proxy settings must be configured. This can be achieved by adding these lines to your ~/.gitconfig
(create if necessary):
[http] proxy = http://127.0.0.1:4444 [https] proxy = http://127.0.0.1:4444 [git] proxy = http://127.0.0.1:4444
If the proxy is needed for only a few repos, one can also utilize the -c
of Git:
git -c http.proxy=http://127.0.0.1:4444 clone http://example.i2p/myrepo.git
Note that this method doesn't store the proxy information within the repo configuration, so the same -c http.proxy=...
settings must be applied on each invocation.
Limit fetched commits
Git (by default) fetches the full history of a repo, which can be hard for I2P connections to sustain. Git provides the --depth=N
argument to only fetch N commits from the top:
git clone --depth=1 http://git.idk.i2p/i2p-hackers/i2p.i2p.git
The repository can then (step-by-step if needed) be unshallowed by git pull --deepen=N
.
Hide timezone
Git shows the local timezone in commits. You might want to change that to something more generic, such as UTC.
git commit --date="`date --utc +%Y-%m-%dT%H:%M:%S%z`" -m "added new feature"
Servers
Main page: Eepsite/Services#Code
There are several Git services within I2P.
Name | AH/B32 | Description |
---|---|---|
git.idk.i2p | AH B32 | idk's GitLab service, hosts I2P's code |
git.community.i2p | AH B32 | Gitea based Git hosting |
Setup guides
- In-Network: http://i2p-projekt.i2p/en/docs/applications/git - Git over I2P for users
- Clearnet: https://geti2p.net/en/docs/applications/git - Git over I2P for users