views:

345

answers:

10

I'm a PHP/MySQL developer who hasn't used any form of versioning aside from copy/paste into a backup folder. I develop Windows, as well. Where should I go, and what should I do to start using Versioning and Control software?

I'm curious, do these methods also apply to the databases you're using and their schema's?

+8  A: 

Subversion. Its solid, and you can use TortoiseSVN as a client in windows (if you're on windows). Eclipse also has good subversion support.

I don't know enough about database question but at a minimum you could have versioned sql exports.

EDIT: Subversion, and TortoiseSVN are free :-)

There's a similar linux 'port'of TortoiseSVN called Subdiversvn but I haven't used it that much

David Archer
And Versions for OS X svn support - http://versionsapp.com/
Mark Pim
Make sure you understand the limitations of Subversion's branch support before you jump in head first.
Kelly French
This will help http://svnbook.red-bean.com/
Mercer Traieste
In my experience, Subversion's branch support in 1.5 and above is actually pretty good (although I don't have much experience with alternatives to compare).
Josh Kelley
But don't forget. He'll also have to setup his Subversion repository. (A task that's beyond the scope of those client tools.)
Nate
Which Subversion plugin do you recommend for Eclipse?
Josh Kelley
@Nate - Creating a local Subversion repository with TortoiseSVN is as simple as right-click, TortoiseSVN, Create repository here.
Josh Kelley
@josh, subclipse http://subclipse.tigris.org/
David Archer
@Nate - Pretty sure Versions supports creating local repositories from within the app too :-)
Garry
+2  A: 

My personal tool of choice for Windows is TortoiseSVN, which is a GUI front-end to Subversion. You can also use Git if you have nothing against command-line interfaces (or see this for Git GUIs).

As for database versioning, I use my own tool called Wizardby - it supports pretty much everything I need, including native SQL.

Anton Gogolev
A: 

If I were starting fresh I would look at one of the newer generation of distributed version tools like mercurial, git, or bazaar. Here is a decent write up of git vs mercurial vs svn.

acrosman
+3  A: 

I you are the only one working on the source I would recommend using git or mercurial. Unlike SVN, there is no need to set up a server. If you are developing on windows, I would recommend mercurial with TortoiseHg.

epotter
though I've never used these, I've heard of them. The only problem I would forsee with not setting up a server is that you don't have offsite backups as such. Does that sound right?
David Archer
there's no need to set up a server with svn either - you can use file: URLs
kdgregory
That is definitely a problem with keeping the repository local-only. You can use git to work locally and then eventually push your changes to a remote repository at your leisure. I use SVN at work and I like them both.
MattC
@David, as MattC mentioned, with git and mercurial, there is an option to push source to a server. So it can be backed up off site.@kdgregory - I wasn't aware that was an option with SVN. Are there any drawbacks to using SVN way?
epotter
@epotter - not that I know of, although it's definitely not something that I'd want to do with a team, due to possible permissions problems. I just run *svnserve* in daemon mode, even for my "team of one." Also, it's possible that the file: URL won't work with a DB-backed repository, but again, for personal use I'd go with a file-backed repo (and reading between the lines, it seems the SVN people would as well).
kdgregory
A: 

Ditto on the TortoiseSVN with Subversion. I would also suggest using a hosted SVN repository like google code or xp-dev.

ProgrammingPope
+1  A: 

I've switched from Subversion to Git. Branches are important to me and Git's branch support is unmatched. I use the Windows GUI mostly and the command line occasionally.

Also, it definitely applies to database schemas. Keep all your DDL changes as text files and version them. I used to work on a large Sybase database that the DBA's couldn't reproduce without restoring from a backup tape and cleaning out the tables. They didn't have the DDL to create the DB from scratch and even if they did (there are several tools that could generate it) they weren't setup to handle versioning anyway.

Kelly French
Which GUI do you use? I'm loving Git on Ubuntu, but it's hard to coerce my Windows colleagues...
Dean
@Dean - I started with Git GUI but am moving to Git Extentions
Kelly French
+1  A: 

Depending on what you are developing and where/how you develop. If you are developing stuff and constantly on the move I would use a distributed source control like GIT/Mercurial or if you are always developing them from the same place and can always access your repository then I would recommend SVN

AutomatedTester
+1  A: 

If you are coding in a team, have a look to Trac too. Basically, Trac allows hyperlinking information between a computer bug database, revision control and wiki content. It also serves as a web interface to a version control system like Subversion, Git, Mercurial, etc.

Paolo Moretti
+3  A: 

If you are new to source control I would start by reading about the basic concepts first.

Brad
+1 -- I am in the same position as Jonathan, but with less work experience. The article is going to get me from the "60,000-ft view" to something like ground level, which is always the first big step forward. (Last week I made my first Selenium tests through Firefox browser!)
Smandoli
+1  A: 

Subversion (SVN) is probably the only source versioning control software you will ever need to know. TortoiseSVN is a nice client for Windows.

For database schema, what I normally do is to create a sub-folder called "db" and put all my schema there. Be it MySQL, Oracle, MsSQL, etc. I then check the folder into SVN.

You would probably want to have schema upgrade scripts in that folder too.

Blake