Topics Covered
What is Git?
Creating a Repository
Git Commands
Applying a Patch from Drupal.org
Creating a Patch for Drupal.org
Slide 3
Slide 3 text
What is Git?
Version Control System (VCS)
Track changes to a set of files over time
Many file types – txt, php, jpg etc
Developed by Linus Torvalds
Used by Drupal to manage core/contrib
https://github.com/git/git
Slide 4
Slide 4 text
Git is Similar to Computer Games?
Slide 5
Slide 5 text
Saved Games
Slide 6
Slide 6 text
Git Commands
Slide 7
Slide 7 text
Creating a Repository I
git init
Initialises a new Git repository
What’s Changed?
git diff
Display all changes in the working directory
Similar to git status
Slide 18
Slide 18 text
Patching Drupal
What is a Patch?
Slide 19
Slide 19 text
Patch Anatomy
Command used to create the file
Affected Files
Hunks of Changes
Slide 20
Slide 20 text
Patching Drupal
Why Patch?
Fix a bug
Add functionality
How to Patch?
Manually
With Git
Slide 21
Slide 21 text
Applying Drupal Patches - Manually
Manually add changes to the code files
Look for RTBC or confirmation from other
Drupalers
Apply patch in dev first!
Applying Drupal Patches – with Git
Instructions are on the project page
Clone project with Git
Download patch to module/theme directory
git apply -v [patchname.patch]
Creating Drupal Patches
1. Search issue queue first
2. Newest version of project where bug exists?
3. Clone code from drupal.org
4. Create the patch
Coding and security standards
Make changes
Test changes
Name patch: [issue_name]-[short-description]-
[issue-number]-[comment-number].patch
Submit to issue queue
Slide 26
Slide 26 text
Demo – Creating a Patch
Instructions are on the project page