This document provides an introduction to using Git for version control. It discusses why version control is useful, especially for solo developers or teams working on code-based projects. Git is recommended as the most popular open source version control system. The basics of Git are explained, including creating repositories, making commits, and hosting code on platforms like GitHub. Distributed version control is contrasted with centralized systems like SVN. The document concludes with information on tools for using Git and setting up common workflows.
Human Factors of XR: Using Human Factors to Design XR Systems
Git In One Evening
1. Git in one Evening
● Who am I, and what is my context?
● Why use version control at all?
● What are the options?
● Why choose git?
● Git basics
● Github goodies
● Git as part of your workflow
● Questions and discussion
2. Who am I, anyway?
● Long time developer (perl, php)
● Primarily work in Drupal
● I work with a small team – I'm the primary
back-end dev, we have one themer
● I do sometimes contribute to the Drupal
project.
3. Why use version control?
● Also called “revision control” or “source
control”
● Use cases (code == text files)
– Solo, CMS site building, no custom code
(useful at times)
– Solo, CMS site building, custom code (theme
files, etc.) (very useful)
– Solo or Team, custom code (essential)
– Team, CMS site building, custom code
(essential)
4. Version Control Options
● Old skool: CVS/SVN (client/server)
● New skool: Git, Bazaar, Mercurial (distributed)
● Git is by far the most popular, and has
become the industry standard for version
control. Used for the Linux kernel
● Mercurial is used by Python, and others
● Bazaar is used by Ubuntu, and supported by
Canonical
5. Distributed Version Control
● SVN (and its predecessor, CVS) had only
one repository, and it was central. You
committed code to that repository. Your
working copy is only a copy of the code, with
metadata (in the form of .svn directories).
● With distributed version control, everyone has
a repository – so every version is basically a
fork.
6. Distributed Version Control, cont.
● Synchronization can happen by peers
exchanging patches
● Commits, reverts, etc. are fast, because they
happen locally.
● You can work productively (like on a plane)
without having to connect to a server
● Branching and forking are a lot easier
● It is easier to contribute to open source
projects
7. Why Learn Git?
● It is distributed version control
● It is the most popular
● It is used for the drupal project (I notice
wordpress is still using SVN.)
● It is in increasing use in PaaS systems
(Heroku, etc.)
● You'll improve your chances of getting a job
(git knowledge is increasingly asked for.)
8. How to get git
● Linux
– apt-get install git (Ubuntu/Debian)
– yum install git-core (Fedora/CentOS)
– Download from http://git-scm.com/
● Mac OS X
– Graphical Git
installer:http://code.google.com/p/git-osx-
installer
– MacPorts
● Windows
– http://msysgit.github.io/
14. Git Repository Hosting
● You could theoretically do peer-to-peer, but
the standard is to have a “bare” repository
hosted somewhere
● You can easily host it yourself on a VPS
● Commercial hosting options provide goodies
– GitHub
– Bitbucket
– Others
15. GitHub
● github.com
● Free for open source/public projects
● Modest cost for private repository hosting
● Lots of nice goodies, including issue tracking
16. Git Workflow
● Depends on use case
● Teams
● Branches
● Remotes as “servers” a la cvs/svn
● Challenges integrating with DB based CMS
config changes