Skip to main content
Joachim's blog

Main navigation

  • Home
  • About

Breadcrumb

  1. Home

git

By joachim, Sun, 27/01/2019 - 07:19

Unnatural file changes with git

When you check out a branch or commit with git, two things happen: git changes the files in the repository folder, and changes the file that tells it what is currently checked out. In git terms, it changes what HEAD points to. In practical terms, it updates the .git/HEAD text file to contain a different reference.

But these two operations can be done separate from one another, so that while the files correspond to one commit, git thinks that the HEAD commit is another one.

Tags

  • git
By joachim, Fri, 27/03/2015 - 13:46

A script for making patches

I have a standard format for patchnames: 1234-99.project.brief-description.patch, where 1234 is the issue number and 99 is the (expected) comment number. However, it involves two copy-pastes: one for the issue number, taken from my browser, and one for the project name, taken from my command line prompt.

Tags

  • git
  • patching
  • drupal.org
  • workflow
By joachim, Thu, 27/11/2014 - 08:39

A git-based patch workflow for drupal.org (with interdiffs for free!)

There's been a lot of discussion about how we need github-like features on d.org. Will we get them? There's definitely many improvements in the pipeline to the way our issue queues work. Whether we actually need to replicate github is another debate (and my take on it is that I don't think we do).

Tags

  • git
  • drupal planet
  • issue queue
  • patching
By joachim, Tue, 10/07/2012 - 19:20

Git tricks: repatching for an issue branch

My workflow for making patches is to use a feature branch for a single issue. Whether you're a contributor or a maintainer it lets you advance the fixing of the problem in small increments, and safely experiment knowing you can roll back.

But where it goes wrong is when your patch is superseded by a newer one in the issue queue, and you want to work on it some more. How do you update your branch for the ongoing work? As ever, with git there's a way.

Tags

  • drupal planet
  • git
  • issue queue
  • patching
  • drupal
By joachim, Fri, 06/07/2012 - 08:30

Git tricks: being on the wrong branch

I often find that I'm in the middle of one thing when I have to do another. Whether it's hotfixes for a client, or just finding a minor bug that blocks my current work, or needing to add components to a feature before I can add custom functionality.

The best way is to stash your current work, checkout the master branch, commit, then go back. If you're working on a feature branch (and you should be), then rebase that afterwards so you have access to the new work there. So that's:

Tags

  • drupal planet
  • git
By joachim, Thu, 03/05/2012 - 07:41

Get out, git!

There are lots of good reasons to have your server's codebase be an actual git checkout. But there's one potential flaw: your entire repository's history ends up in your webroot inside a .git folder.

You can block access to it in your .htaccess, but that's hacking core (until this patch lands at least).

There is however an alternative method that lets you keep the entirety of git's working folder outside the webroot completely.

Here's how to convert an existing repository to this format:

Tags

  • git
  • drupal planet
  • security
By joachim, Fri, 24/02/2012 - 10:32

Moving a git local branch from one local to another

You're maybe at one of the many Drupal Co-worker Friday events that are taking place around the world today. You've packed up your laptop and your lunchbox, and you're looking forward to a day out of the house with some human contact.

Tags

  • drupal
  • drupal planet
  • git
git

Frequent tags

  • Drupal Code Builder (9)
  • git (7)
  • module builder (6)
  • 6.x (5)
  • drupal commerce (4)
  • development (3)
  • Entity API (3)
  • Field API (3)
  • patching (3)
  • Drush (3)
  • Composer (3)
  • drupal.org (2)
  • debugging (2)
  • multisite (2)
  • tests (2)
  • Drupal core (2)
  • core (2)
  • issue queue (2)
  • modules (2)
  • roadmap (2)
  • 7.x (2)
  • Rector (2)
  • developer tools (2)
  • wtf (2)
  • contributing code (2)
  • code style (2)
  • contrib module (2)
  • maintaining projects (2)
Powered by Drupal