This tutorial takes a look at applying a patch from Drupal.org to your local copy of a module or Drupal core using Git. Afterwards we'll look at how you can create your own patches, using git diff
and git format-patch
, in order to contribute code back to Drupal or any of the module's on Drupal.org. You can see a full Git workflow using GitHub in the lesson Git Workflow: Putting It All Together.
Additional resources
Git Best Practices: Upgrading the Patch Process article
Applying a patch in a feature branch
In this tutorial, Joe walks you through a typical Git workflow. We start with cloning a repository, creating a branch, and getting some work done. Then we go ahead and commit our work, merge it into the master branch, and push our changes back up to the remote repository.
We've now learned about all sorts of commands in git and the flags that accompany those commands. We've also seen that some of those commands can get to be a bit long and are used quite often. In this lesson we're going to take a look at how to create command aliases in our .gitconfig file so that we can have a shorthand for accessing some of these more esoteric commands. We'll also take a quick tour of Joe's personal .gitconfig file that he uses in his day-to-day work.
This video shows you how to create your own custom shortcuts for various commands. We'll look at some common aliases and see how to add them to our command line environment. This is super handy for commands that you type in all the time and don't want to go through the tedium of typing the whole thing out every time. For example, we show how to automatically go to a particular directory with just one word (e.g. type "clients" and go to the /Users/add1sun/lullabot/clients directory immediately).
This video looks at the basics of working with MySQL from the command line. We get into the mysql environment and look at databases, tables and fields. We cover creating and deleting databases, creating a user, and querying within a particular database.
Note: In some places the command line prompt is cut-off. The YouTube version of this video doesn't have the cut-off problem. We are working on getting this fixed, but in the meantime, check out the YouTube version instead.
Command Line Basics 13: Using MySQL from Command Line (youtube.com)
This is an introduction to the Tail command, available on Unix/Linux systems. Tail has many applications, but this video concentrates on its basic usage and useful options, as they pertain to Drupal developers.
You'll learn how to take a quick peek at recent log messages from a single log file, how to do the same thing with multiple logs, as well as watching log files in real time! We'll finish up with a practical application, to see why this is useful.
Commands used in this video:
To view the documentation (or manual) for the tail command:
man tail
To show the last 20 lines of the webserver's access log file:
tail /var/log/apache2/access.log
To show the last 20 lines of the webserver's error log file:
tail /var/log/apache2/error.log
To show the last 20 lines of the webserver's error log file and continue to print new lines added to the file:
tail -f /var/log/apache2/access.log
In this tutorial, I'll introduce the API Blueprint specification and take a look at a few tools we can use to provide documentation and testing for our API.
The tools we'll look at include:
By the end of the tutorial you'll have a better understanding of the API Blueprint specification and be able to use Dredd and Aglio to ensure your API documentation and testing stay up-to-date.
Self-check question: Could you write a script that could be run after every commit that would keep your documentation up-to-date, and provide API test results?
Additional resources
Git
TopicThe Git version control system can help you keep track of changes in your codebase and make sure you don't unintentionally lose work.
Security
TopicKeeping a Drupal site secure requires monitoring security announcements, performing regular updates, and knowing how to properly use Drupal’s APIs to write secure code.
Drupal Composer Project
TopicThe Drupal Composer Project provides a scaffold for starting a new Drupal project and managing that project's dependencies with Composer. It was created before the drupal/recommended-project Composer project template was developed, which is the current best practice method for creating a new Drupal site with Composer.
HTML and CSS
TopicHTML and CSS are the foundational languages for how browsers display web pages.
YAML
TopicYAML, which stands for YAML Ain't Markup Language, is a human-readable data serialization format that's been widely adopted in a variety of use cases in Drupal.
Xdebug
TopicDebugging your Drupal codebase can be made substantially easier by learning how to enable and configure the Xdebug PHP extension.
Learn about resources to guide you through the process of updating a module or theme to the latest version of Drupal.
Drupal Core Modules
TopicA module is a set of PHP, JavaScript, and/or CSS files that extends site features and adds functionality. The Drupal core software comes with a set of modules that provide a range of features.
The command line can be a scary place for someone not familiar with interacting with a computer through text-only. We are so used to using GUIs to point and click our way through tasks. In this series we'll walk through some of the most common command line tasks to help you understand what is going on and be able to do some cool tricks yourself.
This is the first video in a series that shows basic command line usage for *nix systems, such as Linux, Mac OS X, and on Windows, using applications like Cygwin. This video shows the following commands and spends the most time explaining how to move around your file structure from the command line:
- pwd
- ls (and ls -al)
- less
- cd
- man
- clear
Note: this video was originally released August 31, 2009 on Lullabot.com.
The second video in the command line basics series, this one covers common commands for dealing with files; copying, moving and deleting them. We walk through examples for the following commands: cp, mv, and rm.
Just a a fair warning that I say the word "stuff" way too many times in this video. Please just bear with it.
Note: this video was originally released September 8, 2009 on Lullabot.com.
In this next video of our command line series, we will look at permissions and ownership of files and folders - how to understand the information you see and change it. It covers the following commands:
- chmod
- chown
- chgrp
- sudo
Note: this video was originally released September 16, 2009 on Lullabot.com.
This command line video covers the three most common commands for compressing and archiving files, including how to get them back out again. Most commonly you first hit the need for these when you download a file and need to get it uncompressed. We'll cover the following commands:
- zip
- unzip
- gzip
- gunzip
- tar
Note: this video was originally released October 28, 2009 on Lullabot.com.
This video shows how to use the magical symbolic link, or symlink. These are basically a handy *nix way to create shortcuts. They come in particularly handy if you want to organize code for your websites outside of the web server's document root and that is the example we use here.
Note: this video was originally released November 23, 2009 on Lullabot.com.