Git – A Distributed Revision Control System

Embed Size (px)

Citation preview

  • 8/8/2019 Git A Distributed Revision Control System

    1/17

    GitA Distributed Revision Control System

    Drupal User Group Switzerland2010-09-01

    Matias E. Fernandez

  • 8/8/2019 Git A Distributed Revision Control System

    2/17

    History

    Developed by Linus Torvalds First version in 2005

    Maintained by Junio Hamano

  • 8/8/2019 Git A Distributed Revision Control System

    3/17

    Key Advantages

    Its very fast! Excellent native support of distributed

    development paradigm Collaboration can occur over many media:

    SSH, HTTP, WebDAV, FTP, or emails (noneed to open special port)

    https://twiki.cern.ch/twiki/bin/edit/CDS/WebDAV?topicparent=CDS.GitAdvocacy;nowysiwyg=1https://twiki.cern.ch/twiki/bin/edit/CDS/WebDAV?topicparent=CDS.GitAdvocacy;nowysiwyg=1
  • 8/8/2019 Git A Distributed Revision Control System

    4/17

    Key Advantages

    Branching/merging is a native centralconcept

    Robustness: internal le formats are verysimple; corruption is very rare andrecovery very simple

  • 8/8/2019 Git A Distributed Revision Control System

    5/17

    Why Drupal chose Git?

    Three initial candidates: Mercurial, Bazaar

    and Git The d iscussion: http://groups.drupal.org/

    node/48818

    http://www.lullabot.com/blog/git-coming-soon-drupalorg

    http://www.lullabot.com/blog/git-coming-soon-drupalorghttp://www.lullabot.com/blog/git-coming-soon-drupalorghttp://www.lullabot.com/blog/git-coming-soon-drupalorghttp://www.lullabot.com/blog/git-coming-soon-drupalorghttp://www.lullabot.com/blog/git-coming-soon-drupalorg
  • 8/8/2019 Git A Distributed Revision Control System

    6/17

    The many GitWorkows

  • 8/8/2019 Git A Distributed Revision Control System

    7/17

    Dictator and Lieutenantdictator

    lieutenant

    lieutenant

    blessed repository

    developer developer developer developer

    http://peepcode.com/products/git-internals-pdf

    http://peepcode.com/products/git-internals-pdfhttp://peepcode.com/products/git-internals-pdf
  • 8/8/2019 Git A Distributed Revision Control System

    8/17

    Integration Manager

    integration manager developer private developer private developer private

    blessed repository developer public developer public developer public

    http://peepcode.com/products/git-internals-pdf

    http://peepcode.com/products/git-internals-pdfhttp://peepcode.com/products/git-internals-pdf
  • 8/8/2019 Git A Distributed Revision Control System

    9/17

    Central Repository

    shared repository

    developer

    developer

    developer

    developerdeveloper

    developer

    developer

    developer

    http://peepcode.com/products/git-internals-pdf

    http://peepcode.com/products/git-internals-pdfhttp://peepcode.com/products/git-internals-pdf
  • 8/8/2019 Git A Distributed Revision Control System

    10/17

    Setting up Git

    git cong$ git config --global user.name Matias E. Fernandez$ git config --global user.email [email protected]$ git config --global color.ui auto

    git init$ git init

    git add$ git add .

    git commit$ git commit -m my first commit

  • 8/8/2019 Git A Distributed Revision Control System

    11/17

    Working with Branches

    git branch$ git branch -al

    $ git brach -d mybranch

    git checkout$ git checkout myotherbranch$ git checkout -b mynewbranch

    git stash$ git stash$ git stash apply$ git stash clear

  • 8/8/2019 Git A Distributed Revision Control System

    12/17

    Sharing Code

    git clone$ git clone git://git.drupalcode.org/projects/drupal.git

    git push$ git push origin

  • 8/8/2019 Git A Distributed Revision Control System

    13/17

    RTFM!

    Git has an extensive and very thoroughdocumentation: use it!$ git help [command]

  • 8/8/2019 Git A Distributed Revision Control System

    14/17

    Git Tools

    GitX http://gitx.frim.nl/ GITK http:// git-scm.com/

    http://git-scm.com/http://git-scm.com/http://git-scm.com/http://gitx.frim.nl/http://gitx.frim.nl/
  • 8/8/2019 Git A Distributed Revision Control System

    15/17

    O nline Resou rces http://git-scm.com/ http:// progit.org/ http:// www.kernel.org/pub/soft ware/scm/

    git/do cs/ http:// www.ke rnel.org/pub/software/scm/

    git/do cs/user-manual.html http:// www.gitready.co m/

    http://www.gitready.com/http://www.gitready.com/http://www.kernel.org/pub/software/scm/git/docs/user-manual.htmlhttp://www.kernel.org/pub/software/scm/git/docs/user-manual.htmlhttp://www.kernel.org/pub/software/scm/git/docs/http://www.kernel.org/pub/software/scm/git/docs/http://progit.org/http://www.gitready.com/http://www.gitready.com/http://www.kernel.org/pub/software/scm/git/docs/user-manual.htmlhttp://www.kernel.org/pub/software/scm/git/docs/user-manual.htmlhttp://www.kernel.org/pub/software/scm/git/docs/user-manual.htmlhttp://www.kernel.org/pub/software/scm/git/docs/user-manual.htmlhttp://www.kernel.org/pub/software/scm/git/docs/http://www.kernel.org/pub/software/scm/git/docs/http://www.kernel.org/pub/software/scm/git/docs/http://www.kernel.org/pub/software/scm/git/docs/http://progit.org/http://progit.org/http://git-scm.com/http://git-scm.com/
  • 8/8/2019 Git A Distributed Revision Control System

    16/17

    Books

    Version Control with Git http://oreilly.com/catalog/9780596520137

    Pro Git http://progit.org/

    Git Internals http://peepcode .com/products/git-internals-pdf

    http://progit.org/http://peepcode.com/products/git-internals-pdfhttp://peepcode.com/products/git-internals-pdfhttp://progit.org/http://progit.org/http://oreilly.com/catalog/9780596520137http://oreilly.com/catalog/9780596520137
  • 8/8/2019 Git A Distributed Revision Control System

    17/17

    Drupal Related

    Resources

    http://drupal.org/handbook/git

    http://drupal.org/handbook/githttp://drupal.org/handbook/git