tags:

views:

1162

answers:

11

Is it worth going to GIT from SVN when the repositories are mainly accessed by a single developer? I have several machines that I use for development and not mainly develop in C#. But I have a mix of VB, VB.Net, PHP, C#, C++, HTML, Batch, BASH and many more in my repositories. What, if anything, will I gain by migrating to GIT from SVN? Right now use TortoiseSVN + VisualSVN Server with a set of central repositories and several client machines. While I have granted a few friends access to my repositories they do not Update or Commit often (if ever).

Also is there a way to have the flexibility and ease of maintenance I get with VisualSVN Server + TortiseSVN with Git?

((I'll bite... what other platforms and trickery would be compelling for a single developer/small group?)

Please List Pros and Cons not just one sided opinions.

Current Tool Chain... Visual Studio 2008 (C#/VB.Net) + TortoiseSVN + VisualSVN

Main Focus... XNA Games, WCF/Socket Services, Web Development

+3  A: 

No. At least not for me. What's the point of having a non-centralized repo for a single dev?

Also, the Git Windows tools aren't quite up to the TortoiseSVN bar.

Ben S
What's the point in setting-up/maintaining a centralised SVN server for a single developer?
dbr
@dbr If you have to ask, you wouldn't understand.
mxmissile
I want roll back and use multiple clients. As well as want access to my code from anywhere.
Matthew Whited
Rolling back to any revision in SVN is quite easy. Also, my linux box with SVN has a dynamic DNS setup and is visible from any internet connection. It hosts 2 repos with about 200-300 commits a month from about a dozen people. We have developer branches setup, but no-one has needed them yet.
Ben S
I disagree with your first point, but completely agree on the second. Git on windows is a pain.
jshen
@Ben: your setup is similar to mine other than I am now running Windows on the backend (used to be Linux but that's a different story) How happy are you and your team with merges and so forth?
Matthew Whited
git is local, doesn't require a server. the .git folder is the entire repo, right there in your working copy. Why would you want to setup an svn server and have it run all the time in the background? git is a simple tool (like any other), doesn't require any server setup.
hasen j
Okay. first you can use SVN as a local copy if you want. Second see the comment from mxmissile. As well as I share the repositories across 4 computers (and I switch between then while working on code)... think VMs but more expensive...
Matthew Whited
@Matthew Whited I'm very happy with my setup, our merges happen quite nicely in WinMerge and we only had one minor issue with one devo who moved folders around without using tSVN properly. But that's more related to user error than anything else.
Ben S
+3  A: 

One thing that may be compelling about Git is that you can continue to work and do commits offline. So, when you are on the plane, bring your laptop and commit as usual. When you are back online, you can push back to your main repo.

If you find you do a lot of branching you will probably prefer Git, as it is designed around making branching/merging easy and commonplace.

Update: Note you can test out Git without committing to it, since Git can talk to SVN repos. So give it a try, and if you don't like it, nothing lost!

RedFilter
Couldn't you just create local SVN respoitories if you want Offline and merge it back when you get back online. As well as I hang my SVN off my personal server so I have access to it where ever I can get on the internet
Matthew Whited
Yes, that's possible.
Martín Marconcini
+6  A: 

It really depends on your workflow. Do you work often from places where you cannot reach your svn server? Do your projects have a large number of branches because you like working on several (big) things at the same time? Do you copy working copies between machines? Do you split off new branches from an existing branch? Do you sometimes work on the trunk and halfway through a bunch of changes think "I should have done this in a branch"? If so, then it may be useful.

From a single developer's point of view, the main difference between a central system like svn and a decentral system like git is that in svn the revisions are linear. With git it's a tree. This is useful when you work on bigger features that you want to do in multiple commits.

Example: You have a big feature F that consists of changes a, b, c and d. With Subversion you'd either commit a, b, c and d separately on the trunk, or you'd create a branch which means you have to do a lot of merging. With git you check out a working copy, commit a, b, c, and d on it. Then you'd push that as a single change F to your master. So, instead of four commits you see just one commit on the trunk. This makes it easier to see from the log what is going on.

You could do this with svn branches as well. But now suppose that part a also consists of multiple parts, like a1 and a2.

Such a development model can be done with Subversion. Python Twisted is done that way for example. All development is done on branches and nobody works on the trunk. But git makes such a workflow easier.

Sander Marechal
Most of my stuff is for my own personal projects so honestly I don't even branch. But that is a good point
Matthew Whited
+12  A: 

I can give you three advantages:

  1. You can have multiple back up repositories. Git isn't centralised, so you can keep your repo on whatever machine you're working on and push changes to any back up locations you have. I keep my repos on github, and two other locations.
  2. Branching, merging, rebasing, amending commits, git bisect. Just because you are a single dev, there is no reason not to use the best tools.
  3. git-svn - you can give it a try in parallel with your subversion repos while you make your mind up.

There is a disadvantage; and that is that the visualisation tools available on Windows are not as user friendly as those that are, perhaps, available for other platforms.

Abizern
1- You can do that with svn too. Just use the file system instead of the daemon.2 - When you are alone, you don't use most of this features. They exists because of the concurrency and the need to communicate.3 - the git learning curve is pretty straight. It's an incredible tool, but spending days to set up the environnement and learn how to use it the first time... Is it worth trying when you are alone ?
e-satis
@e-satis: that is the question I was trying to get answered. And to me it seems to be "not yet" at the very least.
Matthew Whited
1. Okay. 2. I disagree with you. I'm a single dev and I branch/rebase all the time. And the tools are not just there to make concurrency possible. 3. On Windows, sure. On a Mac/Linux it's trivial to set up the environment. IMHO - it's worth moving, particularly as a single developer - you don't have to use SVN just b because your team does. HOWEVER; Windows support is poor - and that is a factor.
Abizern
So being that I now mainly develop on Windows and want my GUI tools I should just stick with SVN.
Matthew Whited
Git suits the way I work. If I was still on Windows I would use git. But if you'd rather have visual tools, I suppose staying with your current tools is a better choice for you. However; git isn't the only DVCS. I'd recommend you try one that is better supported; Mercurial, or Bazaar for instance.
Abizern
A: 

Look into Bazaar (bzr). Seriously, it is amazing. Best merge capability I've seen.

xeon
What is the advantages you see in bzr for merging? Also I don't use merging much beyond helping to find bugs (I don't have a current need for patching)
Matthew Whited
I agree that it is worth looking into, but be aware that compared to git, it's slow.
Abizern
+3  A: 

Just try it, install msysgit, then

git svn clone svn://mysvn/repo/

Some of the resources in Git for beginners: The definitive practical guide should be of help (Gitcasts and Git Magic especially)

Personally I find git much more pleasant to use in general. I switched my personal SVN repos to git about two years ago and haven't had a single problem with it ever

Not having to worry about your SVN server is nice (no need for constant network access to it), so is being able to trivially create repositories (they're just a folder containing another .git folder), perform any operations (commit, branching etc etc), then decide to put the code on Github with a simple command or two.

It's generally much "snappier" (almost every action basically instant), everything works "offline", clones are complete backups.. but the main reason I keep using it is Github

dbr
How much of a pain is it to keep track of changes from several systems? I typically have a working copy on 3 to 4 computers at once.
Matthew Whited
It's very easy. Being able to merge changes from separate repos, particularly repos created by other people, is one of it's main design points.
Abizern
How much over head is it for a single developer to use serveral workstations. It's not uncommon for me to commit my code from one of my computers to update and change on another.
Matthew Whited
Using git on multiple workstations is one of it's strong points. The D in the DVCS makes it especially suited to that workflow. It's one of the things I like best about it (especially when one of the machines has no network access!).
Dan Moulding
It sounds like it works pretty similar to how I currently manage my source. But it also sounds like I don't need the extra overhead from the tiered design when I am happy with my current tool chain.
Matthew Whited
A: 

I would also look at mercurial...

Tim
A: 

If you are used to Tortoise SVN, then you should try Mercurial, which has a Windows package with a similar shell extension Tortoise HG. Also Joel Spolsky is using Mercurial at Fog Creek (according to him in one of his podcasts).

The package is completely stand-alone, I was able to install and use Mercurial right away (doesn't even need a server!)

DSO
May have to check this out, but to the point of if it ain't broke... I might just say to heck with it.
Matthew Whited
One thing missing from Mercurial is inter-operation with SVN (as smooth as git svn). It's coming soon, I think, but not quite here yet.
Craig McQueen
+2  A: 

I have used these systems in the manner which you describe, under Windows with Visual Studio 2008:

  • Visual Source Safe
  • Subversion
  • Mercurial
  • Git

If you value your life, do not ever use Visual Source Safe...

Subversion

  • Pros: Excellent tools, both on the server and client side. VisualSVN and TortoiseSVN.
  • Cons: It doesn't handle merging things too well.

Git

  • Pros: Excellent merging support, fast.
  • Cons: Windows tools are almost non-existent, the GUI ones that do exist are so horrible, I hope I don't ever have to use them again. (my opinion)

Mercurial

  • Pros: Excellent merging support, decent tools. TortoiseHG and VisualHG, Python based - hook scripts can be written in Python, hooking directly into the HG api.
  • Cons: Tools are not up to the same par as with SVN.
Redbeard 0x0A
I use VSS as work and agree it's not the greatest... but there are worse... I used ClearCase at a previous job and HATED it
Matthew Whited
The issue that I have had with VSS is that it eats my work from time to time. When you have to re-do the past 4 hours worth of work, its irritating. Its also fun when files mysteriously revert to a previous version...
Redbeard 0x0A
You've got a wrong point. windows tools *do* exist, they're just as stable and usable as the linux tools. I use the distribution from msysgit.
hasen j
I have been lucky enough to not have it do that too me yet. But when I was using ClearCase I had problems with the source control trying to maintain two copies of the the same file becasue it would get confused with the casing of file names. And this was a HUGE pain in the ass for Windows development. I did a zip/wipe history more than once becasue the sysadmin could not fix the isue.
Matthew Whited
@hasen-j: The issues I had with msysgit was with networked drives, it kept on crashing and made it much less effective (even mapped network drives). It is possible they may have fixed that since I last worked with git.
Redbeard 0x0A
+4  A: 

Yes, of course.

You're misunderstanding what git is. I mean, why would you assume it's only useful for teams?

git is even more worth it if you're a single developer.

Pros:

  • svn requires a server to run in the background. git on the other hand, is a simple utility, you just run it as if you're running grep or ls or any other simple command line utility. You don't need to setup any server or anything like that.
  • The .git folder is the entire repository, you can take it with you anywhere (for example, on a USB stick) and it will always have your repo. Your entire repo, along with its history, and everything else, and it's actually compressed very well, so it doesn't take that much of space. (Hint: that's why git doesn't need a server; when you run git commands, git just changes the internals of the .git folder).
  • Branching and merging is really easy. You can work on experimental new features on a separate branch, and only merge when its stabilized. Meanwhile, you can do maintenance work on the master branch (e.g. bug fixes) and all the while you can keep merging the bug fixes from the master branch into your experimental (topic) branch with ease.
  • This point is subjective, but I find it much easier than svn. I tried to use svn for a while, but found it too complicated, and often it got in my way (I don't exactly remember that what's and why's, I just know it wasn't a pleasant experience). For example, renaming files is not an issue. You can rename files and git won't make any fuss, it just doesn't care about the file name. The only thing is, you have to remember to add it after you rename it, it's as if you created a new file.

Cons:

  • Not many visual tools. There's a git-gui, it's not bad, (I haven't used it much) but you don't wanna depend on it. You need to get used to using it from the command line. If you're used to visual tools with svn, this maybe a con, but in my opinion, the only con here is that you have to step a little bit out of your comfort zone to learn it; but trust me it's worth it.
  • There maybe some issues with line-ending on windows, it's not a big problem if you're the only developer, but if you're developing on windows and others are developing on linux, you need to make sure that all files use unix-style line ending instead of windows', in order to avoid any issues.
  • Due to lack of visual tools, resolving conflicts (when they appear) might be trouble some at first. I personally use WinMerge, and invoke the command winmergeu <conflictfile> on every conflict file, to resolve conflicts. (Note: WinMerge is not a command-line merge tool, it's a visual merge tool, with a normal gui).
  • This brings me to another point. While it's really easy to get started with git, there maybe some learning curve to dealing with issues that come up later (such as conflict resolution). If you don't branch and merge, then you won't even run into conflicts, but then again you'll also be missing a very powerful feature.

UPDATE:

I didn't notice the bit about you working from several different machines.

It doesn't make a difference, you just have to remember to push and pull whenever you switch to a different machine, but you already do this with svn: commit/update.

You'll get the power of branching/merging. Don't under-estimate this power.

How many times have you thought of implementing some crazy idea, but never dared to do it because you don't want to mess up your code? git relieves you from these worries. Just do it in a branch, if it works out, merge it to the main branch, if it didn't, delete the branch and forget about it.

Sure, you might say that you can do the same with svn revert, reverting back to the revision before you started the crazy idea. but what if you had bug fixes applied in the meantime? If you revert your crazy idea, you'll lose all the bug fixes/maintenance work you did while experimenting with your crazy idea.

hasen j
SVN doesn't require a server. I just use it to have access to my respoitoies from anywhere. And you can just as easily carry the SVN repositories (most of my repositories started life as a directory on an old Linux server and were moved to VisualSVN Server when I updated to Windows Home Server). Also I have no interest is using the commandline tools to manage my code.
Matthew Whited
WinMerge is a visual merge tool. winmergeu is just a way to launch it from the command line, but it's a full-blown gui, not a command-line tool.
hasen j
I want something along the lines of TortoiseSVN so it seems like it's just not ready for me.
Matthew Whited
To your point of branching. I have a repository just for those ideas. It's a mess and I like it that way (not really but it's too late to save.) Besides with these being person projects it takes a pretty insane idea for me to not just try it. Worst case I just erase the local copy and do a new checkout from my server. Don't get me wrong I do see the point if this was production products but it is my collection of hobby code.
Matthew Whited
Also with .Net development those crazy ideas go in their own assemblies or at the very least namespaces until I refactor them else where. I should probably also note that I really don't roll back or look at the history nearly as much as I commit pretty much don't leave comments and have no problem mixing spikes with commits.
Matthew Whited
"It's a mess and I like it that way", really? I have a friend whose idea of version control is to create zip archives every once in a while, and he says he likes it that way. (I was there too, btw). Believe me, once you get used to git branches, you can't ever get back to doing it any other way.
hasen j
the mess code is just a bucket of test/spike code. nothing in it is worth branching. It is simply a collection of ideas. Also with not having to maintain old code I have no need for patching. My source control is really only used for that "oh crap I can't undo". I may find the branching/trucking useful... but if I ddi I would use those features in SVN. I even gave up on trying to "rename" files and directories correctly becasue simply I don't care about the long term history for a file. Again this is hobby code and not production code.
Matthew Whited
renaming is not an issue in git, quite frankly git doesn't care what's the file name. The only thing is you need to remember to git-add the file after you rename it (as if you created a new file). I suppose I should add this to the Pros?
hasen j
I have no issue with my current method of renaming either. SVN support renaming but their was a bug I was fighting in Tortoise a while back. That issue was fixed but simply put... I still don't care. I don't use version control for history. More of just a bloated UNDO.
Matthew Whited
Me too, to me, that's what history is for: undo. When working alone, I only need the history for undo, and the branch/merge for testing wild ideas. The second point is why git is better than svn.
hasen j
If for the second point you mean the portability... you can do that with SVN as well. If I copy my repository to my local machine I can access the file db directly. As well as I can just use the code that I checked out from a remote share. I agree Git has some nice features but if the tooling isn't on par I have no interest in moving... maybe in the future.
Matthew Whited
No, I mean branch/merge. (the second point in my previous comment).
hasen j
Ahh... well if I say anything else about not caring about branching and merging the dead horse might just wake up...
Matthew Whited
+4  A: 

Apart from what has already been said, If you're a single developer and haven't experienced troubles with SVN I see no reason to switch. svnserve (the daemon) works fine locally (I have OS X).

TortoiseSVN is a blessing compared to Git tools… is there any particular reason why you'd like to move away from Subversion?

Martín Marconcini
My reason for posting this question is simply the fact I see more and more people using Git and I was wondering if I was missing anything. Currently it looks like I will lose more than I will gain.
Matthew Whited
You win. There is no need for me to change my current tool chain. This may change as the tools improve but for now the best plan looks like to stay with what I have. -Thanks
Matthew Whited
Gotta love down votes without comments.
Matthew Whited
well, it's subjective, my comments are already in my answer.
hasen j
But at least you placed a comment.
Matthew Whited
Hehe, Well, I'm sure everyone who downvoted is a git fan, and their views are pretty much summed up across the pro-git answers.
hasen j
yeah... it seems that way (you Linux/Opensource guys get that way)... Oh and I'm being a smart ass about it becasue I used to be one as well.
Matthew Whited
I'm not much of a linux guy, though I'm trying to force myself to migrate to it. Quite frankly I don't use much of windows anymore, all computings tasks are done by third party tools: launchy, xyplorer, console2, git, firefox, etc. The only programming advantage for windows is Visual Studio, and I admit that it's a huge advantage, but I haven't used it in a long time anyway.
hasen j
Nice... well a few years back I went the other direction. I used to be a huge pro Linux and evil M$ hater. Now I love the tools i get from Microsoft and hate the cludge of crap I have to hack together to get a Linux box up.
Matthew Whited
I tried linux a couple of years back, it was Fedora, and I hated it with a passion (as Linus says about CVS). Now I'm on linuxmint (on virtualbox), and it seems to be a breeze.
hasen j
I have always been a Slackware Fan. I have used almost every version since 3.6
Matthew Whited