I just thought I post a little information about a presentation I am going to be giving at the October meetup. At the last meetup, I was asked if I would mind giving a presentation on the use of GitHub in managing Drupal projects. We have pretty much switched all of our development versioning to Git at CollectiveColors.com, because it has shown to have significant benefits in our own development processes.
Git makes it easier for us because:
- It allows us to better collaboratively develop our software while minimizing the impact of code conflicts.
- Allows us to easily track what we have developed.
- Branching and merging of repositories is a breeze.
- It is very easy to turn any directory tree into a Git repository.
- Git submodules are perfect for Drupal development.
We have learned a lot of really cool methods for managing software projects using Git and GitHub, so we figured that we would share some of what we have learned in our journey so far. Although, I have a rough outline of what I want to talk about during this presentation, I am open to hearing your suggestions, after all I'm not presenting to myself.
So what I am thinking so far? ...
Managing Drupal projects with Git and GitHub
1. What are Git and GitHub?
Seeing that there will probably be people at the meetup that do not use versioning for their development, or have not heard of Git, I will be covering, briefly, what Git is and why it is important to developers. Why use Git over CVS ( used by Drupal ) or SVN ( a much better CVS )? What are some of the features that make Git so useful? I will also be introducing GitHub, a truly ( logical ) awesome service for Git enthusiasts. GitHub basically makes it very easy to track development and collaboratively develop software projects. Think of it as social networking meets software development. And Gists are really cool too! You will learn why these tools are invaluable assets in your own software development efforts.
2. Why are Drupal and Git a good fit?
Drupal and the Linux kernel have a lot in common. They are both really popular open source projects. They both have more modular architectures which lend themselves well to the distributed source control methods employed by Git. In fact Git was created by Linus Torvalds for use on the Linux kernel so that the larger code base could be more easily managed by a group of dedicated developers. The module system of Drupal also lends itself quite well to a submodule approach to site building. I will be introducing you to this approach. Also you will hear about some resources that could make your Drupal development even easier with Git.
3. How do you set up a Drupal project?
I will be taking you through the process of creating a Drupal project using Git. Should you host your project on your own server ( via SSH ) or should you use GitHub? Each has it's own strengths and weaknesses. Since distributed project development requires networked repositories, I will be briefly covering the available options to you in starting a project that can be externally accessed and developed.
4. Toto, we're not dealing with drupal packages anymore.
When you work with Git repositories of modules that you use everyday, you will notice that it is a shift from the way you used to do it. No longer do you go to drupal.org and download packages. In fact, you don't even use drush, but it is just as easy. So what do you do when modules or core are updated? How can you use the Git approach to manage your client codebase? This is where submodules come in handy. The traditional Drupal motto has been don't hack core. What if you could, safely? Using the awesomness of Git merging and distributed source control, centrally managed software development may not be necessary. We will discuss the pros and cons of such an approach. I would really like to git your feedback. Ha ha.
5. Come together. ( The case for collaborative development with GitHub )
GitHub is really freakin awesome ( did I mention that already? ). It makes it easy for non technical people to understand what is happening with the projects that they are interested in. This can really help you reach people that could benefit from your code. I will discuss some of the benefits to working on projects together and how it can help us share what we develop easily with one another. The decentralized Git approach gives us an easy way to fork projects. We can then merge features from other developers or from our own forks. This gives us a lot of power to radically and safely evolve our code, and that is what gives us our advantage.
6. Managing data with Git.
Have you ever thought about versioning your database? Versioning your database can be a great way to backup and recover your precious data. What would we be without our 1's and 0's? Well, I decided to try versioning Drupal databases with Git and Drush around the end of August. I thought I would try an experiment. On one hand I would have a regular backup process dump and zip database snapshots, and on the other a git repository with a single uncompressed database dump that was commited at an interval. The results over the month have been quite impressive. I will go over the results and why I think that versioning your database is the absolute best way to manage your data. It works for all kinds of databases, even flat files. I will also be releasing the shell script that I wrote to perform the git backups for me.
So now you have an idea of what I think I should be talking about. What do you think?
Oh, one more thing. Don't hesitate to read up on Git or GitHub before the meetup. Trust me, it will be worth your time. Git and GitHub really can change the way you develop.
This is the official Git site. It has a lot of good documentation.
Take a look around GitHub. Try registering for a free account to get a feel for the interface.
The book [ Pro Git by Scott Chacon ] has proven to be most useful in my quest for information. It also goes over the internals which is really cool.
And of course, you always have the Git man pages.