Skip to main content

Articles tagged with "git"

Customise scaffold files the right way

16th Jun 2020

There are some key files like robots.txt and .htaccess which are often tweaked for Drupal websites. These can be considered part of the 'scaffolding' of a site - they control the way the site works, rather than its content or design. Any new release of Drupal core that includes changes to them specifically mentions that they need updating, as those changes may have to be merged with any customisations made on your site. For example, there was a security release that added rules to .htaccess, which were essential for any site to incorporate and the template settings file, default.settings.php...

Read more

Quickly update Drupal core

18th Oct 2018

Update: this article's suggested method has serious shortcomings, use other methods when you can! For example, run the following with drush to just upgrade drupal core code (leaving database updates to be run separately):

drush pm-updatecode drupal --check-updatedb=0

If you've got a Drupal site, which you need to update quickly (for example, to address last night's security advisory!), here's a tip. Run this from the command line:

curl 'https://github.com/drupal/drupal/compare/7.59..7.60.patch' | patch -p1

This assumes your codebase was on Drupal 7.59 and you're currently in Drupal's root directory. If you're currently on a different version, adjust the numbers in the...

Read more

Commands I use when creating a patch for drupal.org

Jo Fitzgerald
Jo Fitzgerald
20th Dec 2016

I have honed a selection of commands that I regularly use in the creation and application of patches. Here is a run-down of my most useful commands.

Read more

Good practice pays off for Drupal site security

12th Nov 2014

Much has been said about last month's highly critical Drupal security issue 'SA-CORE-2014-005', otherwise known as 'Drupalgeddon'. It was covered by mainstream international media, even if the reaction needs addressing. Drupal's security team take a responsible approach to security issues - being open & honest in disclosing them with fixes, in keeping with the community values. Security issues should always be expected in any software, it's how they are dealt with that speaks far more.

We patched all the sites that we had access to immediately fix, and informed all our clients of the issue as soon as possible. If you host a Drupal site, and haven't yet, run through the Drupalgeddon workflow right now.

Read more

Quick tips: Adding an empty master branch

21st Feb 2012

When I create a git repository for a new project on Drupal.org I don't bother to create a master branch, branches named 6.x-1.x or 7.x-1.x have special meanings and are the ones that we're encouraged to use. However, drupal.org doesn't allow us to [change the default branch][branch-issue] on d.o itself, so even though there may be no branch called 'master', it's still the default branch, so sometimes cloning a repo will fail:


git clone http://git.drupal.org/sandbox/darthsteven/1268648.git
Cloning into 1268648...
remote: Counting objects: 177, done.
remote: Compressing objects: 100% (176/176), done.
remote: Total 177 (delta 103), reused 0 (delta 0)
Receiving objects...

Read more

Quick tips: Adding an existing project to a drupal.org sandbox

19th Jul 2011

Most projects start with you trying out something locally, getting it working and then after some initial testing you might then want to publish the project on Drupal.org. Sandboxes are a great way to throw up some code and the perfect place to pop random code that others might find useful or a project that you just don't want to maintain. If you go and create one on Drupal.org then you'll get helpful instructions for creating a new git repository and creating a basic module to go in the repository and then pushing that code to Drupal.org's servers. But what...

Read more