Version Control

Posts tagged with "Version Control."
  • 8


    Getting Git Thanks to PeepCode

    It's pretty clear that Git has landed. More and more projects are migrating to Git for their version control needs and developers have another system we need to get up to speed on.

    I'm usually a traditional dead-tree book learner, but this time I decided to try the PeepCode approach. I had heard good things about them and I can now tell you that reputation is well deserved.

    PeepCode has two resources available for those wanting to learn more about Git. First, there is a one hour screencast called Git covering everything from installing through basic usage. There's also a newer 120 page PDF book called Git Internals, that ships with some different screencast material. You can purchase either product for $9, which really is a steal in my opinion. Both are well done, but let me break down their strengths for you below.

    The original screencast is a great resource for the developer who wants to get up to speed on Git in a hurry. You just watch for an hour, perhaps try a few examples as you go, and you should come out the other side with basic Git usage skills. An added bonus is that the screencast covers Git's Subversion integration which is a topic you don't want to miss, but it's sadly missing in the PDF book. It also has some good tips on configuring the gitk browser under Mac OS X.

    Read more…

  • 4


    Add to Subversion

    I love Rails generators and I love Subversion, but I'm not so sure they love each other.

    Little is worse than generating some scaffold files or a login system, tediously typing svn add ... a bunch of times, and later learning that you missed a file. Oops.

    Given that, here's my hack to get the Rails generators and Subversion to kiss and make up:

    desc "Add generated files to Subversion"
    task :add_to_svn do
      sh %Q{svn status | ruby -nae 'system "svn add \\#{$F[1]}" if $F[0] == "?"'}

    I put that in "lib/tasks/add_to_svn.rake" for all my Rails projects. You can then access it whenever you need with rake add_to_svn.

    I've seen similar tasks posted, but they've always been Unix specific and I work with some Windows programmers. This is my attempt to help both on platforms.

    How does it work?

    You're probably not use to seeing ugly Ruby code like that, but Ruby supports a lot of command-line shortcuts that it inherited from Perl. Here's a breakdown of the options used:

    -e The code to execute directly follows this option.
    -n Wrap my code in a standard Unix filter style processing loop.
    -a Auto-split each line of input.

    Read more…