Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was wondering if there was something new in here. Instead it's a tale of a company that's been living under a rock for the last four years.


Under a rock? Is git _that_ much better? I used to read about how it didn't need a central repository, yet this article, and github, seem to indicate everyone ultimately wants/needs a central repository.

So git is worth switching just for branching/merging superiority? Maybe I don't do it enough, but svn has never let me down. Or maybe I'm not on a large enough dev team?

Guess I'm really just trying to figure out if git is so amazingly better that I really am under a rock (I'm not seeing that), or if it's more of the "if you're not using {latest hip tech} you're not to be taken seriously" kind of thing that we see so much on HN.

(sorry about new account -- can't find original credentials)


Yes, git is THAT MUCH BETTER.

I wish I had time to get in all the details about why git is better but I will leave you with two questions to ask your existing version control system:

1. How fast is your version control system?

Unless you have tried git, you will not realize how painfully slow SVN (or any other VCS which has to talk to server) is. 90% of my git operations take less than a second.

Now, you may say that 'speed' is not an issue. Trust me, it is. Once you have a super fast VCS, you will embrace it as your friend in everyday coding instead of using it at the end of the day. It's something similar to what Google thinks that making website/webapp faster brings in more users.

2. Can your version control handle renames?

There are very few version control systems out there which can handle renames. If you dread renaming files because of SVN, you ought to look at git. BTW, not only can git handle renames without a hitch, it can show you code history across file renames.

Again, you may think that 'renaming' is not an issue. But if you believe that 'naming' is very important for your code and you do re-factoring all the time, you don't want your version control system to dictate how you work.

I can imagine why one may think that git is fad. But after using it for 2 years now, I can not use any other version control system. [And for a background, I have used following version control systems for real proejcts: CVS, VSS, Perforce, Surround SCM, SVN, TFS.]


I use SVN at home and in a 9-5. It's works fine.

1) Fast enough? I have tried git. It's pretty cool, but the difference between 5 seconds and 1 second is minimal at best to me. I don't think I've found myself dying for a faster SCM, though I usually make maybe 1 - 5 commits per day. Git on Win32 is meh compared to git on Linux, so that doesn't really convince me any further either. Git is also a PITA to compile on !Linux using !gcc, because heaven forbid we write using ANSI/ISO C.

2) Yes? I can do renames, but strictly speaking it is not an atomic "rename" operation. I don't particularly care about rename history, and I'm not really sure why others do, but I guess if I tried I could make up a use-case for it. Still, it wouldn't be a selling feature for me, that's for sure.

It seems strange to me that you take the time to tell us that "git is better", like we're comparing O(n) to O(log(n)) algorithms. Different workflows, projects, and organization structures have different needs. It seems hopelessly naive to simply assume everyone's needs are best fit by git, and git alone.

How about this: I want to tell, given two revision numbers in the mainline branch, which came first? In SVN, it's pretty simple. In git? Well, first open a terminal...then ...argh. As release manager, it's kind of annoying. Simple use case: is 2aa8aca05357004d4418807c06f53d81517bc629 before or after e8d0555ce401b6acb0f225aa0263e9b72136347d? Did e8d0555ce401b6acb0f225aa0263e9b72136347d make it into the build given that 5b5c73ceaa442bafff08b4470aad3ff276be94e3 was the final commit before the cut-off?

I might waste 5 seconds opening a terminal window or tab, 30 seconds finding, copying, and pasting the revision numbers, then a second or two determining the answer. This, to me, is not a productive use of my time when revision numbers simply tell me what I need to know. All of that magical time git just saved me might have just been absorbed or gone into time debt.


"1-5 commits per day"

Have you ever thought about why do you only have 1-5 commits a day? I do 70 to 100 commits a day. I commit each and every semantic change. I do not commit changes so that I have a backup of my code, I create a commit so that I can track my 'semantic code change'.

Let me give you an example:

Let's say I have a working website. The website has header/footer/content style. I spend one hour to customize my website layout by modifying html/css.

When I am done with header, I commit my HTML/css.

When I am done with footer, I commit my HTML/css.

When I am done with content, I commit my HTML/css.

During my work, I found a bug in CSS which fixes float in IE and I created another commit for this particular bug fix.

The most important point being that each of my commit is 'independent' and represent a meaningful unit of work.

You may ask, why create 4 commits instead of one? The reason is that git will let me use these commits anyway I chose.

It's 2.30pm and my manager stops at my desk and tells me that I have to fix the float but in IE 'RIGHT NOW' before the 3pm meeting. I am only needed to fix the float bug and nothing else because the website has to match with printed material for the meeting. How do you do it? Easy. git will let me 'cherry-pick' my last float bug commit and merge it in to current production branch. After merging the one particular commit, I test everything to make sure nothing is broken and I am all set before the 3pm meeting.

Obviously, this was a simple case. There will be cases where you can not just pick one commit as it depends on other commits. You will have to do more work to get the fix in. Git is the helping hand which can let you play with the commits to get the answer you want. SVN can not do that.

Going back to my point, I think you may not realize that you do far fewer commits than you should because your subconscious brain knows that commits are slow. Once your brain will realize that commit can take less than a second, you will automatically commit more often.

To give a unrelated example: Back in the day when we didn't have access to high speed Internet, we would consult local documentation only because searching online was slower than finding it locally. Now, with Google and high speed Internet, I have stopped downloading documentation locally and rely on Google to find it for me.

'caring about rename history'.

Again, this is dependent on the way you code. I like to re-factor my code a lot. I rename my classes whenever I find a better name. I move my code around in different folders as I find better way to organize my code. And as I re-factor a LOT, I DEFINITELY care about my code history. Git can track renames/folder movement and still show you the file history. You may not care about rename history now but you may care about it in future. With SVN, you have no choice. Git offers you that choice.

Now to your workflow comment. The beauty of git is that it is a 'content tracking' tool. You can use it to FIT any work flow you like. git does not force you to use any particular workflow. You can use it in the exact same way you currently use SVN. Or you can come up with your own workflow which no other team in the world uses. It's all fine.

Finally, the revision number comment. Generally, I haven't had a need to figure out which revision came first based on 'revision numbers' alone. But once again, git has an answer. You can use git describe command. It will give you something like:

"git describe gives you a version description like the following: v2.0-64-g835c907. The v2.0 part is the name of the latest annotated tag preceding the commit, 64 is the number of commits after that, and 835c907 is the abbreviated commit id. It is basically there to identify any revision in an exact and convenient (although technical) way."

From: http://stackoverflow.com/a/1817099/92414

And that's the beauty of git. Git already has a way to address your common concerns and if it doesn't, you have enough meta data to make it work the way you want to.

Once again, I really understand where you are coming from because I was on that side once. But I sincerely believe that git is a much better tool and it will change your life as a developer. It has definitely changed mine.

Please, please, do yourself a favor and at least experiment with git before dismissing it.


Yes, SVN can handle renames. And maintain history across renames.

Btw, SVN supports partial checkouts (git doesn't). Which I use regularly on a gigabyte repo.

I use git regularly for all my hobby projects (mainly because 'git init' seems way simpler than the equivalent svn command), and I might even start a company off on git, but I'll never claim that SVN is obviously a bad way to do things.


Git supports grafting, also using enormous multigigabyte svn repository that contain numerous projects is SVN cancer.


Actually, I've had many more problems with git renames than with SVN ones. IIRC, it has to do with git internally tracking content, not really filenames. So, I've had cases where changes then a rename result in git thinking a new file was created and an old one destroyed.

But, at the end of the day, I rename files so infrequently that it's hardly a selling point or problem on either system.


Do you care to elaborate on point #2? In svn I can do "svn mv" to rename files. I don't see how this is more difficult than just "mv". Maybe the history of file renames is somehow more easy to follow in git? If I run "svn log renamedfile", I can see the history across file changes.


With git, I don't have to tell it that I renamed file. It can even figure out if I moved the file from one folder to another. And with git, I can see the complete history without worrying about the fact that the name might have changed in the past.


Yes, git is that much better. Branching is only part of that. Another part is speed—and especially network speed. Git makes operations, during which in SVN I could go, make some coffee and come back just to find them still running, instananeous. Then there is rebasing. Then there is differntiation between author and commiter. Etc., etc.


> github, seem to indicate everyone ultimately wants/needs a central repository

Of course you still need some centralization in order to share work with other people. But the more compelling thing about Github is forking, not centralization. With Git you can easily synchronize commits between multiple remote repositories.


Even at that, branching isn't hard at all on Subversion. I know that before 1.6 it was more cumbersome, but making a branch for my work and committing a lot of small changes and then merging back when done isn't hard.

There's also the benefit of being able to checkout just one folder of the project wherever you want without having to keep the same folder structure as the source project. I understand git is able to do a "sparse" checkout now, but the parent source folder structure is checked as well.


Simple difference: in svn, until you're ready for other people to see your changes, you have to leave them uncommitted. In git, you say "well, I just refactored function X, let's throw that in a commit before I do anything else, and if I have to revisit it, I will"

I've never had to use svn myself, but it's this aspect that's always sounded positively crippling to my workflow


This is about the only gripe I have about svn. Otherwise, we're so deep into the svn ecosystem that it would be a monumental shift.


There's a fair few extra features you wouldn't think you would need but you'll discover mainly through using it. We made the switch from svn to git a while back and I can't imagine how we used to get by without stash, cherry-pick, bisect etc. There's more to git than just a distributed repository and better branching for sure.


I agree. The entire Internet would have you believe that OSS just didn't exist before the advent of git. I like git and prefer it, but SVN gets the job done. My only real gripe with SVN is it makes it harder for those without commit privileges to commit. Within a company setting, that point is moot. A lot of the other anti-SVN sentiment is based around old versions of SVN. It still doesn't branch as fast as git, but it does have merge tracking.

At the end of the day, use what works best for you. If you want to test the waters, use git-svn. You can then work locally and then dcommit your changes when they're ready to go upstream. It'll give you a pretty good approximation of what git can do for you workflow-wise.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: