Intro To Version Control
Transcript of Intro To Version Control
An Introduction to
Using Version Control
with Drupal
Kathleen Murtagh
Design 4 Drupal -- June 14, 2009
Why use Version Control?
Constant backup of your project
Full history of your project's development
Reuse code that was previously removed
Remove changes that caused bugs
Enable collaborative development
Easier deployment to production
Typical Workflow
Make your changes
Review your edits
Commit
Rinse and Repeat!
Commits are Patches
Multiple developers can work on the same file
View Your Commit History
See your coworker's work
Understand the rational behind changes
Recapture a block of code that was removed
Change Versions of your Code
(Don't be scared of this command line screen shot. I'll show you the graphical apps later)Test previous versions of your project
Find the commit that caused a bug
Remove Commits
Find the commit that caused a bug
Revert the commit in whole or in part
???
Profit!
...
Branching and Tagging
BranchesFork code to allow independent development
A Working branch for significant feature changes
Create new or different versions of a project
Branching and Tagging
TagsSnapshots that are not intended to be modified
Record significant momentsReleases, Stable versions, Testing results, etc
The Version Control Systems
Centralized RepositorySVN (Subversion)
CVS (Concurrent Versions System)
Notable FeaturesAll branches and tags are shared
Linear development
The Version Control Systems
Decentralized RepositoryGit
Bazaar
Notable FeaturesOffline development
Enables shared and personal branches and tags
Sophisticated merging
More complicated
Front-end Tools for Subversion
WindowsTortoiseSVN
MacVersions
Cross platformSmartSVN
RapidSVN
It would be advantageous to your career as a web developer to learn
the command line, though!
TortoiseSVN (Windows)
Versions (Mac)
SmartSVN
RapidSVN
Start Using Subversion
Start with version controlling your theme
Think about the database problem later
Set Up Subversion
Set up a repository
Use a service to manage your repo
Setup a repo with your web host
Install Subversion on your server
Install the SVN client
If you develop on a remote server, install it thereYour remote server may already have it installed!
If you develop locally, install it on your computer
Start Using Your Repository
Experiment with interface options to find what you like the best
Import your theme into the repository
Checkout your theme into the themes directory
Start making changes and committing
Keep Learning.