18
Using GIT with Drupal Drupal Camp Sydney - 18 Oct 2008

Using Git with Drupal

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Using Git with Drupal

Using GIT with DrupalDrupal Camp Sydney - 18 Oct 2008

Page 2: Using Git with Drupal

Who am I

A long time member of the Drupal community. About 7 yrs

Full time Drupal consultant

Lead maintainer of the e-Commerce system

Page 3: Using Git with Drupal

What is GIT

A Source Code Management system created by Linus Torvalds

Decentralized SCM

Amazing branching and merging capibilities

Extremely Fast

Page 4: Using Git with Drupal

Advantages of Git

All commits are guaranteed to be written as is to the repository

Has a chain of evidence to seeing who wrote the patch, who tested the patch, and who committed the patch.

Branches are quick and inexpensive

Merges are extremely powerful

Page 5: Using Git with Drupal

Using Git with Drupal

Page 6: Using Git with Drupal

Interfacing with CVS

Built in ability to access other SCM systems like CVS, SVN, and others.

Can usually import and export to other SCM

Page 7: Using Git with Drupal

Getting code of out contrib.

git cvsimport -d:pserver:[email protected]:/cvs/drupal-contrib -C modulename -a contributions/modules/name_of_contrib_module

Page 8: Using Git with Drupal

Committing changes

Make changes

git add filename

git commit

Page 9: Using Git with Drupal

Exporting changes back

GIT_DIR=path_to_.git git cvsexportcommit -cv hash

Page 10: Using Git with Drupal

Creating a branch

git branch branch_name head_of branch

git checkout branch_name

Page 11: Using Git with Drupal

Merging

git merge branch_name

Page 12: Using Git with Drupal

Using GIT for clients

Page 13: Using Git with Drupal

Base System

Has all modules that I use with all clients. views, cck, panels etc

Update any changes to base system in 1 place.

Page 14: Using Git with Drupal

Creating a site

git clone base new_system

git branch website

Page 15: Using Git with Drupal

Installing new modules

Download tarball from drupal.org, unpack and commit to the repository

Page 16: Using Git with Drupal

Uploading to remote site.Set up remote repository

git clone --bare site site.git

copy site.git to webserver

add remote section to .git/config

git push website

Add to hook to automatically pull the changing into the site

Page 17: Using Git with Drupal

Updating Site from Base

git pull

Page 18: Using Git with Drupal

Questions