Difference between revisions of "Git"

From eLinux.org
Jump to: navigation, search
(re-arrange page)
(fix wording)
Line 8: Line 8:
 
1) git is fully distributed - every repository has the complete history (record of every change set, and the state of the full source tree for every single commit)  Each repository operates in a completely local and standalone fashion.  No network operations are required (e.g. communicating with a master server) in order to carry out operations.
 
1) git is fully distributed - every repository has the complete history (record of every change set, and the state of the full source tree for every single commit)  Each repository operates in a completely local and standalone fashion.  No network operations are required (e.g. communicating with a master server) in order to carry out operations.
 
2) git supports fast branching - git intrinsically support lightweight branching, which promotes speculative or experimental development.  Git allows easy separation of in-progress work from production work.,
 
2) git supports fast branching - git intrinsically support lightweight branching, which promotes speculative or experimental development.  Git allows easy separation of in-progress work from production work.,
3) git supports flexible changeset editing and easy merging from other repositories - With Git you can go back in history and edit commits, delete them, reorder or even merge lots of commits into a single commit for publishing. You can do fine-grained changeset management (i.e. the ability to commit only a portion of the modifications in the current checked-out tree, and the ability to merge only some of the commits from another repository (cherry-picking).)
+
3) git has powerful changeset management - git has very flexible changeset editing and easy merging from other repositories. With Git you can go back in history and edit commits, delete them, reorder or even merge lots of commits into a single commit for publishing. You can do fine-grained changeset management (i.e. the ability to commit only a portion of the modifications in the current checked-out tree).  Also, Git has strong support for tracking other repositories (including multiple repositories) with the ability to merge from multiple sources easily, and to merge only some of the commits from a particular source (cherry-picking).
 
 
  
 
See [[Flameman/git]] and [[git usage]] for a Tutorial and examples
 
See [[Flameman/git]] and [[git usage]] for a Tutorial and examples

Revision as of 10:56, 25 August 2011

Git is a distributed Version Control System used heavily by the Linux Kernel Developer Community and many other open source projects.

See the * Git wikipedia entry for a good description.

Git is distributed: every developer has a copy of the whole project and its history, this doubles as backup as well as makes operations super fast since you don't need to go through network.

Git is about tracking changes to a set of files in a directory tree, in a way that preserves the history of all changes in a robust way. Git is optimized for fast operation even on very large source repositories, and for distributed operations. 3 main principles of git are: 1) git is fully distributed - every repository has the complete history (record of every change set, and the state of the full source tree for every single commit) Each repository operates in a completely local and standalone fashion. No network operations are required (e.g. communicating with a master server) in order to carry out operations. 2) git supports fast branching - git intrinsically support lightweight branching, which promotes speculative or experimental development. Git allows easy separation of in-progress work from production work., 3) git has powerful changeset management - git has very flexible changeset editing and easy merging from other repositories. With Git you can go back in history and edit commits, delete them, reorder or even merge lots of commits into a single commit for publishing. You can do fine-grained changeset management (i.e. the ability to commit only a portion of the modifications in the current checked-out tree). Also, Git has strong support for tracking other repositories (including multiple repositories) with the ability to merge from multiple sources easily, and to merge only some of the commits from a particular source (cherry-picking).

See Flameman/git and git usage for a Tutorial and examples

Additional Resources

Kernel development with Git

Videos

  • Google Tech Talk: Linus' Torvalds on Git
    • This talk is a basic introduction to the motivations for git (including the history around Linus' use of bitkeeper), and mostly about what git is not (not CVS, not subversion). This talks includes discussion of aspects of git that are different from other version control systems, and why this is important. Warning: Linus has a jovial, apparently arrogant sense of humor, that some find mildly offensive.
  • Pratical Guide to Using Git, a tutorial given by the very experienced kernel developer James Bottomley at the Ottawa Linux Symposium 2008
    • This talk has probably the best discussion of practical use of git, and explanation of how git works internally, that I've seen. I highly recommend following along hands-on with his examples. This talk helped me understand merges much better
  • Google Tech Talk: Git: a brief introduction by Randal Schwartz
    • This is a very good introduction to git, giving a complementary talk about what git is and what it does at a technical level.

If you are new to git, I highly recommend

Help for people coming from other systems

Git Hosting

These sites provide (free) hosting services for git-based projects:

Git tips and tricks

Here are a few tips and tricks about git:

* git has extremely cheap branching and merging
* git has relatively slow performance on 'git blame'
* You can see the history of a sub-area of a project, with a command like the following:
  * gitk v2.6.30.. kernel/debug
  * this shows only the commits since v2.6.30 (a tag), and only for the files under kernel/debug

See also Tims Git Notes