In this lesson Joe will explain what an entity is and provide a little bit of history about how they came into being. We’ll also learn about some of the differences between custom entities and nodes (which happen to be a type of entity) and when, and why you might want to choose to write your own custom entities instead of using the node system or a more traditional datastore.
This week we are kicking off a brand new series, Working with Entities in Drupal 7. Entities were introduced in Drupal 7, and are an extremely useful tool, though they have been somewhat confusing for people to work with. In this series we will start out by explaining what entities are, in addition to things like bundles, fields, and entity types. We then spend time understanding how you can use the Entity API to work with existing Drupal entities in you own custom module work.
Recently Drupalize.Me announced that I had joined the Drupalize.Me team. (So exciting!) I'm bringing with me my catalog of training curriculum, including my flagship course, PSD to Theme. The next opportunity for you to take this course is at DrupalCon Portland. This is a full-day course that has sold out every time it's been offered.
The Drupalize.Me Team Has Grown
Blog postWe are delighted to announce our two newest staff members: Emma Jane and Andrew. These two fine folks are no strangers to the Drupal community and we're really excited to have them on board.
In this tutorial we're going to use the git bisect
command to do a little bit of debugging. We're all human, and sometimes bugs get introduced our software and we may not notice them for a while. Especially on fast moving projects. A good example of this would be a performance regression, and now you want to figure out what commit made everything run slower all of a sudden. Bisect allows us to do a binary search between a known good commit and a known bad commit and quickly narrow down which commit introduced the problem. From there it's much easier to figure out what exactly the problem is and fix it.
GitHub is a great, free service that lets you share your Git repositories online with others. In this tutorial, Blake gives a quick tour of our Git Series Example GitHub project, and then explains how pull requests work, letting you merge changes into the repository through the UI. Feel free to try it out by adding jokes to our new jokes.txt file!
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 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.
In this week's installment on the Introduction to Git series we take a look at cleaning things up, and working with remote repositories. Starting off, we work with the reset, clean, and revert commands to allow us to control which state of things we'd like to have our repository set to. We can use reset and clean to discard local work and get us back in sync with the repository. We can also use revert to actually move our checkout to any state we like from the repository history.
This tutorial takes a look at using the git stash
commands to temporarily preserve your work when you need to incorporate other changes but aren't quite ready to fully commit them.
This lesson is all about making two git repositories talk to one another. So far everything we've done has been on your desktop. But we're going to need a way to share changes with other people on our team, or deploy them to our production site. To do that we're going to learn about the git clone, push, pull and fetch commands.
It happens to the best of us, sometimes we commit something that just simply wasn't ready, or maybe we're having a bad day and introduced a bug to the code. I've even seen scenarios where you've created a temporary workaround in your codebase and now you're ready to remove that workaround and put in a real fix. This lesson looks at using the git revert
command to deal with these scenarios by creating new commits that reverse the changes of a previous commit.
In this tutorial, we'll take a look at ways that you can remove changes that you've made to the files in your working tree, how to remove something from the index that you've added but later decided that you're not ready to commit, and some other basic working tree and index house cleaning commands.
In this tutorial, we revisit the git commit
command and take a look at some of the additional things you can do with it, like amending a previous commit, and creating commits using shorthand methods. Then we'll look at using the interactive rebase command which will allow us to reword commit message and do other things like squash two commits into a single commit when performing a rebase.
This tutorial dives deeper into the different things you can do with the git add
command. Things like adding multiple files at a time using wildcards and staging and adding only some of the changes you've made in a file and not all of them. We'll also take a look at using a .gitignore file to exclude specific files or even patterns of files from the repository all together.
In the real world when you're working on a project with a team of people your code never stands still. It's not at all uncommon to find yourself in a scenario where git merge
or git rebase
simply can't successfully meld two branches without human interaction. For example when both branches contain a commit that modifies the same line of code in a file in different ways. This lesson will take a look at how you can go about resolving these merge conflicts and some of the tools available to help make this process easier by first creating an intentional conflict between two branches and then showing how to resolve it.
Release Day: More Git and 700 Videos!
Blog postThis week we're excited to hit 700 great Drupal training videos! The videos that are hitting that goal for us are a continuation of our Introduction to Git series. In this installment we are walking through the important task of resolving conflicts in Git, as well as taking a deeper look at several common commands. Conflicts in your code are going to happen, and it's important to understand how to correct those so you can move on with your work.
In this lesson we're going to quickly jump into the basics of a whole bunch of different git commands and get our repository created, add a couple files, and then view our log.
In this tutorial we'll take a look at creating branches with the git branch
command, and tags with the git tag
command and explain the differences. Then we'll look at how and when they can be used and how to move changes from one branch to another using the git merge
and git rebase
commands and talk about the different ways in which those two commands effect the history of a project.