Until recently, I didn’t really use version control software all that much. I primarily used SVN for a few WordPress plugins, as WordPress maintains a free repository on their SVN server for each plugin a developer submits. While I found it interesting, I didn’t really see the need to use version control for other projects…especially since that would require setting up a server or paying for someone else to host it.
After seeing the six thousandth post/comment/tweet raving about Git, another version control system, I decided to finally give it a closer look. The lightbulb finally clicked on. I now know what’s so special about Git.
Git, unlike, SVN is distributed. You can version your code entirely on your computer, only pushing to a server when you’re ready…if you’re using a remote server at all. When you commit changes, it’s still just updating the revision records on your local computer; you have to use a separate command to push the changes to the remote repository. This means if you’re working alone, without other contributors, you can version files without needing a special server hosting your code, although you lose the convenient off-site backup. This is great for small projects.
Then you have the Github service, with it’s magical socially-networked code repositories. Suppose you have an improvement upon an open source project hosted on Github. You just click a button to “fork” it, creating a new repository under your account with a copy of the original’s contents. You then pull the files down to create a working copy on your system, make your changes, and push them back to your Github repository. If the developers maintaining they original project like your changes, they can merge the changes in your repository back into the main one. That concept amazes me.
I think I’m starting to see why people rave about Git so much. I’ve been aware of it for awhile now, but the concepts didn’t quite “click” until recently.