On Version Control

Depending on your tools and practices, version control can be either burdensome or liberating. At my first programming job, they – gasp – didn’t use version control at all. CVS was the first system i learned how to use, and it changed the way I worked. Looking back, CVS was pretty horrible, but compared to nothing, it was pretty spectacular. At another job, I lead the charge in conversion from CVS to SVN, which was more evolutionary than revolutionary.

The thing I learned during that is that tools that are so integral to how everybody works are not easy to replace. Many people would rather use something that’s holding them back than learn something new. There’s also the issue of stability, maturity, and workflow integration. Being generally pleased with Subversion, and it being so well accepted now, I’d become skeptical of all of these new hotness systems all the cool kids had started using. I figured that, even if they’re marginally better in the way that SVN is better than CVS, it’s not worth the battle.

Last year, I was working on a contract for a company that used git. I bought the very excellent Peepcode introduction to git and was immediately floored with what I saw. Git has changed the way I work in a manner as significant as moving from file based version control to CVS. There’s a new freedom to quickly experiment or completely change directions without the fear of the merge.

Today, I manage a codebase that always has several simultaneous lines of development. I feel more agile. I’m more willing to take on large refactoring projects without fearing what will happen if they’re interrupted by some other task. Since it’s so easy to setup a local repository (git init), a much larger percentage of things I work on are versioned. Features like stashing and partial file commits make it easy to switch context without fear or losing work or dirtying commits.

If you haven’t tried git yet, you should. Take 45 minutes and watch the Peepcode video. You can easily create a shared repository on github. Give it a try.

Balance

It’s always been an unfortunate fact in my life that nothing has driven change in me more than loss. In a former life, I was engaged to be married. I didn’t end up getting married, and the breakup was long and incredibly painful, but it triggered massive positive change in my life. I left a job that was no longer making me happy. I moved to beautiful San Francisco. I took control of my finances so, instead of going into debt as most Americans do after high school, I am debt free aside from my car payment, which I will pay off early.

This past weekend, my long time girlfriend and I broke up. Things hadn’t been going great for a while and we decided together that it was time for a change. To anybody who asked about it, I’ve put on a strong face and told them I’m fine, but the truth is, I’m heartbroken.

Continue reading

Modifying git Commits

I’ve been wondering if it was possible to modify a commit or merge multiple commits in a local git repository. Of course, the answer was only a google1 away. You can’t do this once you’ve pushed your commits upstream, but that’s okay.

There are some good reasons for doing this. The most obvious is probably if you make a mistake in the comments. I like to try to make my commits completely atomic, meaning whatever change I’m making is completely implemented within a commit. This is pretty easy to accomplish if you’re willing to just not commit until you’re done. However, if you have to wait to use your version control system, you’re completely wasting the value of having a local revision control system. If you want to try something out and you’re using git, you can commit, branch, commit, merge, etc. Once you’re happy with your solution, you can package all that stuff into a single, or set of, tidy commits that each make a single, atomic, change.

1 google is used as the noun form of the verb “to google”, not the proper noun “Google”.