Put your work under version control today

There is no project so small, so trivial, that it is not worth you putting it into a Subversion repository. If it's worth your time to work on it, it's worth saving. Putting it in Subversion is a matter of a few statements, and you don't have to do any big fancy-shmancy server setup.

Let's assume you're working on Linux/Unix, and you have svn installed, which is pretty standard these days. Say you're working on a game called bongo, and you've just been keeping it in ~/bongo. Do this:

# Create the Subversion repo
$ mkdir /svn

# Create the bongo repo
$ svnadmin create /svn/bongo

# Import bongo into its project
$ cd ~/bongo
$ svn import file:///svn/bongo -m'First import of bongo into Subversion'

# Move the original bongo directory out of the way,
# in case something goes wrong
$ mv ~/bongo ~/bongo-original

# Check out bongo from Subversion
svn co file:///svn/bongo

At this point, you'll have a checked-out version of bongo in ~/bongo, and you can make commits against it.

Ricardo Signes points out that Git makes it even easier.

# Go to the bongo directory
$ cd ~/bongo

# Import bongo
$ git init

With Git, everything is put in your ~/.git directory, and you don't have to check out anything from the project.

Whatever route you choose, version control is so simple these days there's just no excuse not to do it. Your programming life will never be the same.

Categories:

0 TrackBacks

Listed below are links to blogs that reference this entry: Put your work under version control today.

TrackBack URL for this entry: http://perlbuzz.com/cgi-bin/mt/mt-tb.cgi/310

5 Comments

singingfish Author Profile Page said:

Any chance someone could show the equivalent process to use for git?

Andy Lester Author Profile Page said:

It's in the article. Or is there something else you wanted besides what's in the article?

http://openid.aol.com/pescadero27 Author Profile Page said:

git init doesn't actually store anything. You probably want to follow that up with these calls:

$ git add .
$ git commit -m "Hooray"

Also.. isn't it the case that to use Subversion locally, you need to also run "svnserve -d"? This article seems to be lacking a lot of crucial details!

With bzr it's also as simple as with git (or most other distributed version control systems probably):

$ cd ~/project
$ bzr init
$ bzr add
$ bzr ci -m "Initial import"

The repository then is stored in the .bzr folder in the current directory and may get pushed e.g. on your webserver or uploaded to a service like Launchpad.

bzr is available e.g. in Ubuntu, many other distributions and for Windows.

See bazaar-vcs.org.

stu.myopenid.com Author Profile Page said:

you dont need "svnserv -d" when the repo is file:///

-stu

Leave a comment

About this Entry

This page contains a single entry by Andy Lester published on January 31, 2008 6:17 PM.

Fluent numbers with Acme::Numbers was the previous entry in this blog.

Getting lines from a website with GET and ack is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Other Perl Sites

Other Swell Blogs

  • geek2geek: An ongoing analysis of how geeks communicate, how we fail and how to fix it.
Technorati Profile