Ask HN: Is git/svn right for me?
(Sorry for using HN as a forum... can't think of anywhere else.)
Hi HN,
I never thought I'd need to use a version tracking system, but after having a live site, I'm thinking I do. (Single developer.)
Say I have a feature I need to implement, but would take days or weeks to finish it. In the meantime, I need to fix a bug which could take just a few minutes to fix and deploy. I'm finding myself making whole copies of my site on my local machine, and using the original copy change little things and deploy.
Would git/svn make this easier for me, or am I stuck doing what I'm doing? Thanks!
10 comments
[ 2.7 ms ] story [ 39.9 ms ] threadThat's the only advantage, though. I frankly don't understand the notion that SVN is easier to learn than git. Git has its tricky points (like the index), and its documentation and teaching material have only recently emerged from obscurity, but I think it's conceptually more straightforward, particularly because you can use it without having to set up a server. And you can back up your entire repository by just dragging your working directory to some backup media, so crazy experiments feel a lot less risky.
Start at github. And I learned mainly from the git screencast at Peepcode and the Randal Schwartz Google talk on git.
This book helps, too: http://hgbook.red-bean.com/
My point is merely that, if I were given the choice today to learn a version control system for my own use (like the poster), I would pick git because that seems to be where things are going. svn works well enough for me and I don't see any need to chase after the buzz, but sooner or later I too will probably get around to figuring out the ins and outs of git.
Either one is obviously a vast improvement over no version control.
(Mercurial is really good, too.)
SVN's branching capability is a joke compared to Git, and you'll wonder how you ever lived without easy branching once you get used to having it. This is important even if you're the only developer on the project.
There is a function in git and hg (an extension) called "shelve" which does exactly what you want - you can temporarily set aside the new feature in progress, commit the bugfix, and then go back to working on the feature. (If you knew ahead of time you were going to need to do this, it would probably have made more sense to do the feature in a branch, of course.)
People will argue back and forth whether git or hg is better, but in my experience they do the same things* , they just have different personalities. Pick one, get the hang of using it, and then experiment with the other - you'll be better able to make an informed decision. Both are significantly better than just about every other VC system.
* The advanced features they don't have in common are probably not going to matter until you know all the base functionality, and any new features in either will probably get ported to the other by then.