Git
| 原作者 | Linus Torvalds |
|---|---|
| 開發者 | Junio Hamano、Linus Torvalds |
| 穩定版本 | 1.7.6.1/ 2011年8月24日 |
| 預覽版本 | 1.7.6pre/ 2011年8月24日 |
| 程式語言 | C,Bourne_shell,Perl[1] |
| 作業系統 | POSIX |
| 類型 | 版本控制 |
| 許可協議 | GNU通用公共许可证 版本二 |
| 網站 | http://git-scm.com/ |
Git是一个由林纳斯·托瓦兹为了更好地管理linux内核开发而创立的分布式版本控制/软件配置管理软件。需要注意的是和GNU Interactive Tools,一个类似Norton Commander界面的文件管理器相区分。
Git最初的开发动力来自于BitKeeper和Monotone[2][3]。Git最初只是作为一个可以被其他前端比如Cogito或StGIT[4]包装的后端而开发的。不过,后来Git内核已经成熟到可以独立地用作版本控制[5]。很多有名的软件都使用Git来进行版本控制[6],其中有Linux内核、X.Org服务器和OLPC内核开发。[7]
目录 |
[编辑] 命名来源
林纳斯·托瓦兹自嘲地取了這個名字"git"。在英式英語中指一個愚笨或者不開心的人。[8]
| “ | I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git. | ” |
Git的官方维基也給出了多種其他關於這個名字的解释。[9]
[编辑] 主要功能
Git --- The stupid content tracker,傻瓜内容跟踪器。Linux是这样给我们介绍Git的。
Git是用于Linux内核开发的版本控制工具。与常用的版本控制工具CVS、Subversion等不同,它采用了分布式版本库的方式,不必服务器端软件支持,使源代码的发布和交流极其方便。Git的速度很快,这对于诸如Linux kernel这样的大项目来说自然很重要。Git最为出色的是它的合并跟踪(merge tracing)能力。
实际上内核开发团队决定开始开发和使用Git来作为内核开发的版本控制系统的时候,世界开源社群的反对声音不少,最大的理由是Git太艰涩难懂,从Git的内部工作机制来说,的确是这样。但是随着开发的深入,Git的正常使用都由一些友好的脚本命令来执行,使Git变得非常好用,即使是用来管理我们自己的开发项目,Git都是一个友好,有力的工具。现在,越来越多的著名项目采用Git来管理项目开发,例如:wine、U-boot等[2] 。
作为开源自由原教旨主义项目,Git没有对版本库的浏览和修改做任何的权限限制,通过其他工具也可以达到有限的权限控制,比如:gitosis, CodeBeamer MR。原本Git的使用范围只适用于Linux / Unix平台,但逐步并成熟了在Windows平台下的使用,主要归功于Cygwin与msysgit环境与TortoiseGit这样易用的GUI工具。其实Git的源代码中已经加入了对Cygwin与MinGW编译环境的支持并被逐步完善,对于Windows使用者是个福音。
[编辑] 早期历史
早期Linux的開發人員是使用BitKeeper来管理版本控制和维护程式碼。2005年的时候,开发BitKeeper的公司同Linux内核开源社区結束合作关系,並收回使用BitKeeper的權利。Torvalds开始着手开发Git来替代BitKeeper。
[编辑] 实现原理
Git和其他版本控制系统(如CVS)有不少的差别,Git本身关心檔案的整体性是否有改變,但多數的CVS,或Subversion系统則在乎檔案内容的差异。因此Git更像一個檔案系统,直接在本機上取得資料,不必連線到host端取資料回来。
[编辑] 庫結構
hooks 存儲鉤子的文件夾
logs 存儲日誌的文件夾
refs 存儲指向各個分支的指針(SHA-1标识)文件
objects 存放git對象
config 存放各種設置文檔
HEAD 指向當前所在分支的指針文件路徑,一般指向refs下的某文件
[编辑] 移植性
在Windows平台上有msysgit與TortoiseGit可資利用。TortoiseGit還提供有GUI。
现在git也提供windows版本下载。http://git-scm.com/download
[编辑] 使用
[编辑] 使用Git的專案
有不少的專案目前都使用Git:[10]
- Amarok[11]
- Android[12]
- Arch Linux
- Aquamacs Emacs
- BlueZ[13]
- Btrfs[14]
- Clojure
- CakePHP
- Debian[15]
- Digg[16]
- DragonFly BSD[17]
- Drupal[18]
- Elinks[19]
- Fedora
- FFmpeg [20]
- Freenet
- git[21]
- GIMP
- GNOME[22][23]
- GPM
- GStreamer[24]
- gThumb[25]
- GTK+[26]
- Hurd[27]
- jQuery[28]
- Laika (EHR testing framework)[29]
- LilyPond (music typesetting)[30]
- Linux kernel
- Linux Mint[31]
- LMMS Music Production Software [32]
- Maemo[33]
- MeeGo[34]
- Merb[35]
- MooTools[36]
- One Laptop Per Child (OLPC)[37]
- OpenFOAM
- openSUSE[38]
- Perl[39]
- phpBB[40]
- Prototype.js[41]
- Qt[42]
- Reddit[43]
- rsync
- Ruby on Rails[44]
- Samba[45]
- SproutCore[46]
- Sugar[47]
- SWI-Prolog[48]
- VLC[49]
- Wine[50]
- Xiph[51]
- X.org Server[52]
- x264[49]
- YUI[53]
[编辑] 相关条目
一些著名的采用Git的开源项目:
[编辑] 参考文献
- ^ http://git.kernel.org/?p=git/git.git;a=tree
- ^ Linus Torvalds. Re: [ANNOUNCE Git wiki]. linux-kernel mailing list. 2006-05-05. "Some historical background" on git's predecessors
- ^ Linus Torvalds. Re: Kernel SCM saga. linux-kernel mailing list. 2005-04-07.
- ^ Linus Torvalds. Re: Kernel SCM saga. linux-kernel mailing list. 2005-04-08 [2008-02-20].
- ^ Linus Torvalds. Re: Errors GITtifying GCC and Binutils. git mailing list. 2006-03-23.
- ^ Projects that use Git for their source code management [2008-02-20].
- ^ OLPC wiki. Project hosting [2008-02-20].
- ^ After controversy, Torvalds begins work on git. InfoWorld. 2005-04-19 [2008-02-20]. ISSN 0199-6649.
- ^ GitFaq: Why the 'git' name?
- ^ Projects that use Git for their source code management [2008-02-20].
- ^ Getting Started/Sources/Amarok Git Tutorial - KDE TechBase
- ^ Using Repo and Git (Android Open Source Project)
- ^ BlueZ » GIT access
- ^ Btrfs source repositories - btrfs Wiki. Btrfs.wiki.kernel.org [2009-06-15].
- ^ git.debian.org Git
- ^ digg.git - part 1 | Digg About
- ^ TypicalGitUsage - dragonflywiki
- ^ [1]
- ^ Download
- ^ Get FFmpeg. Ffmpeg.org [2009-06-15].
- ^ Git - Fast Version Control System [2010-04-24].
- ^ Lucas Rocha. Mailing List Announcement [2009-03-19]. "GNOME to migrate to git version control system..."
- ^ Git - GNOME Live!
- ^ gstreamer Wiki - GitDeveloperGuidelines
- ^ gthumb - GNOME Live!
- ^ GTK+ - Download
- ^ source repositories
- ^ Downloading jQuery - jQuery JavaScript Library
- ^ CCHIT's laika at master - GitHub
- ^ LilyPond, music notation for everyone
- ^ The Linux Mint Blog » Blog Archive » Mint to use Launchpad for translations, bugs, blueprints and github for code hosting and version control
- ^ LMMS - Linux MultiMedia Studio
- ^ Maemo - Gitorious
- ^ MeeGo - Gitorious
- ^ Ruby on Rails: Merb
- ^ MooTools - a compact javascript framework
- ^ OLPC wiki. Project hosting [2008-02-20].
- ^ openSUSE - Gitorious
- ^ Léon Brocard. Mailing List Announcement [2008-12-22]. "The Perl Foundation has migrated Perl 5 to the Git version control system..."
- ^ phpBB. phpBB moves source code versioning from Subversion to Git. phpBB Group. 2010-03-07 [2010-03-07].
- ^ Prototype JavaScript framework: Contribute
- ^ Qt now open for community contributions. 2009-05-11 [2009-06-22].
- ^ Reddit Goes Open Source [2010-02-26].
- ^ "Rails is moving from SVN to Git" [2008-04-03].
- ^ Using Git for Samba Development - SambaWiki
- ^ SproutCore Documentation
- ^ Sugar Labs project hosting
- ^ Accessing SWI-Prolog source via <a href="http://git-scm.com/">GIT</a>
- ^ 49.0 49.1 Git - VideoLAN Wiki
- ^ GitWine - The Official Wine Wiki
- ^ Xiph Git
- ^ X.Org Wiki - Development/git
- ^ YUI 2 and YUI 3 Source Code Now on GitHub [2009-01-20].
- ^ http://dot.kde.org/2009/07/20/kde-reaches-1000000-commits-its-subversion-repository
- ^ Press Release(2009-05-11). Qt now open for community contributions [2009-06-22].