I have migrated almost all the source code at work to git… yeah I’m not the first and it’s not the first time you’ve heard something like that, but git is great. If you are not using a version control system or using Subversion you may ask why, I’ll try to explain.
Git is not another version control system, the way git works it will change the way you work. Branches, tags, merges, checkouts, … I know all of this exist in Subversion too, but in git there’s a difference. Your interaction in git is 90% done locally so all the commits, checkouts, merges and operations that you will need to do are done in your local filesystem… that means speed. If you use or had used Subversion you know that a switch between 2 branches gets slower every time your project grows and projects tend to be bigger, not smaller, but the same operation in git is instantaneous. And this applies to all local operations, but someone can think that the downside is in remote operations… wrong! Remote operations are also fast (excluding latency time) including merges, fetch, push and anything you can imagine.
For me Subversion was so slow that when I needed to upload some file to production that I was doing something I ended copying this content to a text editor, reverting the changes and applying the new changes to the Subversion and to the code in the text editor, that was my faster switch for Subversion. Now I can commit my changes in the feature branch I have created and switch to another one to pull the changes from the remote repository, that one increased my life quality. But what happens if you don’t want to commit the changes to the feature branch yet… you can use the stash, using the git stash command all the changes that you have in your current branch are stored in the stash and your code is clean, in that moment you can do whatever you want and when you are finished, go back to the branch and apply the changes from the stash. That’s great!
Now I’m planning on switch from FTP uploads to git deployments… that will be a great improve too because what about those situations where some code is incorrect and you have to revert it, in Subversion this was a hell of a task (well, maybe not that hard) but if you use git tags you only need to deploy the previous tag and you’re done.
That’s my experience based in 1 month of git usage.