Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git Init - Initialise your Git skills for Drupal

Git Init - Initialise your Git skills for Drupal

An introduction to Git with a Drupal slant. Covers basic Git commands and Drupal patches.

Presented at Dundee Drupal User Group meeting - Aug 2013

John Hume

August 21, 2013
Tweet

More Decks by John Hume

Other Decks in Programming

Transcript

  1. Topics Covered  What is Git?  Creating a Repository

     Git Commands  Applying a Patch from Drupal.org  Creating a Patch for Drupal.org
  2. 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
  3. Patching Drupal Why Patch?  Fix a bug  Add

    functionality How to Patch?  Manually  With Git
  4. Applying Drupal Patches - Manually  Manually add changes to

    the code files  Look for RTBC or confirmation from other Drupalers  Apply patch in dev first!
  5. Demo – Manual Patch Feeds module – unique GUID https://drupal.org/node/1539224#comment-7394766

    Image source: http://fourkitchens.com/blog/2011/08/22/apply-patch-clear-cache
  6. 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]
  7. Demo – Patch with Git Waitlist message – entity registration

    module https://drupal.org/node/2018741#comment-7754431 Image source: http://fourkitchens.com/blog/2011/08/22/apply-patch-clear-cache
  8. 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
  9. Further Reading Git  http://git-scm.com/  http://gitref.org/  Install git

    - http://git-scm.com/book/en/Getting- Started-Installing-Git Drupal Patches  http://drupalladder.org/lesson/72a836e6-b408- a7a4-1923-8788761b2608  http://jacine.net/post/8419331209/patches  https://drupal.org/patch/submit