Barcamp Macau 2014 - Introduction to GIT
-
Upload
wong-hoi-sing-edison -
Category
Technology
-
view
136 -
download
2
description
Transcript of Barcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014
Introduction to GIT
Edison Wong2014 Oct 4th
Edison Wong
● CEO, PantaRei Design– [email protected]
● Drupal developer & contributor– https://drupal.org/user/33940
● HKDUG Co-founder– https://groups.drupal.org/drupalhk
● Startup founder– 2009 - PantaRei Design founded
– 2010 - YBHK applicant
– 2011 - ITF SERAP applicant
– 2011 - HKSTP Incu-Tech applicant
PantaRei Design
● Hong Kong based Free and Open Source Software (FOSS) service provider– Content Management System (CMS) with Drupal
– Cloud hosting with Amazon Web Services (AWS)
– Team collaborate solution with Atlassian
● Business Partnership– 2012 - AWS Consulting Partner
– 2013 - Acquia Partner
– 2013 - Atlassian Experts
– 2014 - Rackspace Hosting Partner
● FOSS Contributor– 2008 - Hong Kong Drupal User Group Co-founder
– 2012 - Drupal Services Provider
Outline
● What is GIT?● Why GIT?● 15mins Tutorial● Advanced Topic(s)
What is GIT?
● Distributed revision control and source codemanagement (SCM) system
● Designed to handle everything from small tovery large projects
● Designed and developed by Linus Torvalds forLinux kernel development in 2005
Why GIT?
● Manage code changes by rename file will soonreach its limitation, e.g.– mycode-20140308.php
– mycode-201403080930.php
● Archive entire folder will make case even worse– Need to extract before compare the changes
● Share progress with co-workers becomenightmare
Why GIT? (cont.)
● CVS– Manage revision per file (rename not support)
– Remote repository server required (no local folderoffline management)
– Single commit management (other else contributeby submit patches)
– TOOOOO OLD (well...)● Used by Drupal during 7.x development cycle● After Drupal 7 released, soon migrated to GIT
Why GIT? (cont.)
● SVN– Manage revision per folder
– Remote repository server required
– Single commit management
– A bit better than CVS, but branching model stilllooks crazy
● At least, we now have GIT, why still using SVN?
Why GIT? (cont.)
● GIT– Manage revision per entire project
– Remote/local repository supported● git init● git add --all .● git commit -am 'Initial commit'● git log● git status
– Distributed workflows
– Used by https://drupal.org/ since Drupal 7
– You also know https://github.com/, isn't it?
15mins Tutorial
● git init● git status● git add● git rm● git commit● git log● git remote
● git push● git pull● git diff● git reset● git checkout● git branch● git merge
Advanced Topic(s)
● Continuous Integration (CI)● Migrate to GIT from SVN● Dropbox-like File Sharing
Continuous Integration (CI)
● Test-Driven Development (TDD) or Behavior-Driven Development (BDD)
● Combination with automated unit tests, e.g.running phpunit per each GIT commit– GitHub → Travis CI
– Stash → Bamboo
Migrate to GIT from SVN
● Prepare your environment for the migration.● Convert the SVN repository to a local GIT repository.● Synchronize the local GIT repository when the SVN
repository changes.● Share the GIT repository with your developers via
Bitbucket.● Migrate your development efforts from SVN to GIT.
Dropbox-like File Sharing
● Dropbox– Public cloud-based file hosting service
● GIT– Repository management with history
● SparkleShare– GIT-based file hosting solution with history
– Just manage share and permission as normal GIT repository
– Support public (e.g. GitHub, BitBucket) or private (e.g. Stash, GitLab) GITrepository
– Suitable for small size file sharing
– Dropbox-like operation, NO GIT command is required!!
Dropbox-like File Sharing (cont.)
● BitTorrent Sync– Peer-to-peer file synchronization
– Over the Internet via secure, distributed P2P technology
● Unlike GIT-based solution:– Suitable for large-size binary file hosting
– No complete history support
● How we use SparkleShare and BitTorrent Sync?– BitTorrent Sync: Short-term working copy sharing
– SparkleShare: Long-lasting archive with history
Q&A
References
● http://git-scm.com/● https://try.github.io/levels/1/challenges/1● http://www.slideshare.net/svenpeters/getting-git-
right● https://www.atlassian.com/git/tutorials● http://www.webupd8.org/2011/03/set-up-sparkle
share-with-your-own.html● http://www.webupd8.org/2014/03/install-bittorre
nt-sync-gui-in-ubuntu.html
Thank You
● Please feel free to contact us:– Unit 207, 2/F IC Development Centre, No.6 Science
Park West Avenue, Hong Kong Science Park,Shatin, N.T.
– +852 3576 3812
– http://pantarei-design.com/