DeArmond.net

Thoughts, adventures, projects, and photography by Shawn DeArmond

Beginning to Git It

October 17, 2011 - 9:27pm -- Shawn

I will be presenting "Beginning Git" at 10:30am on this Saturday, 10/22 at the Bay Area Drupal Camp. Ever since I caught wind that Drupal was (finally!) moving off of the archaic CVS version control system, and started planning the Great Git Migration, I took it upon myself to be sure that I learn everything I could about Git.

The time was definitely right for me, in my walk of programming, to start using a version control system. I was writing more and more complex stuff, and I would often start off on a tangent working towards a Really Great Idea, only to determine that it was unfeasible... now what? My file system was rife with files of such creative names as "my_project.backup2.final.final.zip" and other much more useless nomenclature. True, most of my work was done alone, but it would be ridiculous to assume that nobody would ever want to collaborate or even just look at my projects.

Sound familiar?

Well, until recently, the Drupal project was on the CVS version control system. For its time, it was a tremendous program for programmers to collaborate. I'm not really knocking it (much) by saying this, but I know for a fact that I wasn't alone in that it was rather cumbersome to use. And it wasn't much fun to work on one's own computer. You really needed a server to use CVS (since it's a centralized system). Needless to say, it wasn't exactly feasible for my day-to-day workflow.

Enter Git.

Git was like a breath of fresh air. A simple installer on my Mac, and I was Up and Running. I can work on it on my own, I can bring in one or two other collaborators, and I can work together with thousands of Drupal community members. The commands are intuitive, and you can use as few as you can remember, or as many as you need to organize your project.

So, now I want to share the knowledge. I've presented this at Drupal Camp Sacramento Area in May, and I'm looking forward to this encore performance at the largest Drupal Camp ever (so far). If you want to follow along, attached is a pdf of my presentation. I'll link to the video once it gets posted.

Comments

Submitted by Anonymous on

I had the privilege of attending your "Beginning to Git It" talk twice, once at the Sacramento Drupal Camp, and again at BadCamp. I'm now starting to set up my own Git archives, and I've a couple of questions you might be able to answer for me without much effort (if it would be an effort, just point me in the right direction, and I'll chase the answers myself).

1. You demonstrated, and referenced, a Bash configuration that managed to display the current branch label as part of the Bash prompt. I thought I had copied down the reference, but can't find it in my notes. Do you have it handy to resend?

2. I find myself puzzling over the proper granularity for Git archives. On the one hand, putting my whole Drupal installation into a Git archive allows me to maintain it as a total installation, but I also note that parts of it are modules and projects that more or less stand on their own, as far as sharing with others is concerned. Is there a consensus out there about the proper granularity for Git archives? And what happens if you nest one archive inside another?

Submitted by Shawn on

1. Here's the Lullabot article I mentioned: http://t.co/84ytC1UX

2. This is not an easy thing because there are many ways to do it and many schools of thought on the matter. Unfortunately, there is no "best practice" in the Drupal world for doing so. I'll try to describe some possible solutions for you.

First, Git isn't necessarily, on its own, the best deployment solution. If you're trying to do a full-on dev->test->prod automated code deployment system, Git may play an important role, but it's not going to be the be-all end-all. You'll likely end up using something like Jenkins for the automation. On the other hand, unless you're building a mission-critical web site along with several other developers, all working collaboratively, setting up all this stuff may be more trouble than it's worth.

Personally, unless I'm actually working on some core development, patch testing, etc., I normally don't put the whole Drupal core into Git. I'm happy enough just downloading core using Drush, or just the tarball package download. Then, I have some of the contrib modules as separate Git repositories. That way, I can patch them and stay on the bleeding "dev" edge of these modules. Some modules, if I'm not interested in working with the "dev" version, I'll just use Drush to download the recent release.

This isn't necessarily the "best" way to do it, but, as I mentioned, there really hasn't been a "best" way fully hashed out yet. Drupal has only been using Git since, what, March? And "best" for a one-man shop working on a side project is likely to be somewhat different thing than "best" for Lullabot working on a high-profile, high-performance web site, for example.

You ask about nesting one repository inside another. There's something in Git called "submodules". You can look into that, but I've heard that they're pretty complex and not necessarily ideal for this situation either.

The most promising direction I've seen is the DOG project (Drupal On Git) which is trying to solve this exact problem and find out the "best" way to do it. It's still in the very early planning stages, but you might get some ideas in their discussion. You can find more info here:
http://drupal.org/project/dog

I hope this was helpful. Sorry there's no silver bullet here... yet.

Submitted by rating on

The whole article have good piece of information about beginning to git It. This is new topic for me and good piece of content related to it mentioned here. Author did good research on it and part of his resarch like to shared with us. Infect, other friends did good participation in the whole dicussion. Thanks for it.

Submitted by Keegan on

Start of everything should be positive. If anyone have idea to start any project then they must able to have strong plan to do this project or plan in right direction or towards the way of sucess. On the other hand, I try to get some reviews about https://www.needmypaper.com but this article help to change my thinking towards the positive change in life.

Write the principle body of your essay. Each paragraph will increase one of the points that supports the thesis. Begin every paragraph with a topic sentence pointing out the concept you'll cover. Provide proof and rationalization to guide your point, and examine in detail. In the final sentence of the paragraph, hyperlink the factor on your thesis sentence.Support your thoughts with quotes from the textual content if you are completing a literary analysis. Secondary assets will also be required. Check along with your instructor to find out what he expects.Write your end. This should summarize your ideas and persuade the reader that your argument is proper. Re-iterate your thesis and avoid consisting of any new information for your end

Submitted by Kiara on

Open your browser and paste the link http://www.usbestessays.info/ into the browser to view the website. if you get a message page not found like in this one, then retry again, sometimes the server is busy and does not respond.

Showing non-customary sports event to understudies may likewise provide the basic motivation to understudies to expand their action.

Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college

Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. Please keep them coming. Greets!!

Science Channel’s are giving a complete knowledge to its viewers about every thing students write done dissertation on this subjects and show its importance.

Comments

Submitted by Anonymous on

I had the privilege of attending your "Beginning to Git It" talk twice, once at the Sacramento Drupal Camp, and again at BadCamp. I'm now starting to set up my own Git archives, and I've a couple of questions you might be able to answer for me without much effort (if it would be an effort, just point me in the right direction, and I'll chase the answers myself).

1. You demonstrated, and referenced, a Bash configuration that managed to display the current branch label as part of the Bash prompt. I thought I had copied down the reference, but can't find it in my notes. Do you have it handy to resend?

2. I find myself puzzling over the proper granularity for Git archives. On the one hand, putting my whole Drupal installation into a Git archive allows me to maintain it as a total installation, but I also note that parts of it are modules and projects that more or less stand on their own, as far as sharing with others is concerned. Is there a consensus out there about the proper granularity for Git archives? And what happens if you nest one archive inside another?

Submitted by Shawn on

1. Here's the Lullabot article I mentioned: http://t.co/84ytC1UX

2. This is not an easy thing because there are many ways to do it and many schools of thought on the matter. Unfortunately, there is no "best practice" in the Drupal world for doing so. I'll try to describe some possible solutions for you.

First, Git isn't necessarily, on its own, the best deployment solution. If you're trying to do a full-on dev->test->prod automated code deployment system, Git may play an important role, but it's not going to be the be-all end-all. You'll likely end up using something like Jenkins for the automation. On the other hand, unless you're building a mission-critical web site along with several other developers, all working collaboratively, setting up all this stuff may be more trouble than it's worth.

Personally, unless I'm actually working on some core development, patch testing, etc., I normally don't put the whole Drupal core into Git. I'm happy enough just downloading core using Drush, or just the tarball package download. Then, I have some of the contrib modules as separate Git repositories. That way, I can patch them and stay on the bleeding "dev" edge of these modules. Some modules, if I'm not interested in working with the "dev" version, I'll just use Drush to download the recent release.

This isn't necessarily the "best" way to do it, but, as I mentioned, there really hasn't been a "best" way fully hashed out yet. Drupal has only been using Git since, what, March? And "best" for a one-man shop working on a side project is likely to be somewhat different thing than "best" for Lullabot working on a high-profile, high-performance web site, for example.

You ask about nesting one repository inside another. There's something in Git called "submodules". You can look into that, but I've heard that they're pretty complex and not necessarily ideal for this situation either.

The most promising direction I've seen is the DOG project (Drupal On Git) which is trying to solve this exact problem and find out the "best" way to do it. It's still in the very early planning stages, but you might get some ideas in their discussion. You can find more info here:
http://drupal.org/project/dog

I hope this was helpful. Sorry there's no silver bullet here... yet.

Submitted by rating on

The whole article have good piece of information about beginning to git It. This is new topic for me and good piece of content related to it mentioned here. Author did good research on it and part of his resarch like to shared with us. Infect, other friends did good participation in the whole dicussion. Thanks for it.

Submitted by Keegan on

Start of everything should be positive. If anyone have idea to start any project then they must able to have strong plan to do this project or plan in right direction or towards the way of sucess. On the other hand, I try to get some reviews about https://www.needmypaper.com but this article help to change my thinking towards the positive change in life.

Write the principle body of your essay. Each paragraph will increase one of the points that supports the thesis. Begin every paragraph with a topic sentence pointing out the concept you'll cover. Provide proof and rationalization to guide your point, and examine in detail. In the final sentence of the paragraph, hyperlink the factor on your thesis sentence.Support your thoughts with quotes from the textual content if you are completing a literary analysis. Secondary assets will also be required. Check along with your instructor to find out what he expects.Write your end. This should summarize your ideas and persuade the reader that your argument is proper. Re-iterate your thesis and avoid consisting of any new information for your end

Submitted by Kiara on

Open your browser and paste the link http://www.usbestessays.info/ into the browser to view the website. if you get a message page not found like in this one, then retry again, sometimes the server is busy and does not respond.

Showing non-customary sports event to understudies may likewise provide the basic motivation to understudies to expand their action.

Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college

Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. Please keep them coming. Greets!!

Science Channel’s are giving a complete knowledge to its viewers about every thing students write done dissertation on this subjects and show its importance.