KWPro.net

How I Can't Live Without Subversion
By: conark
Published On: 4-8-2009

I've been using version control for years, but only in two environments have I truly used it effectively.  In my current environment at work, I find Subversion as an indispensable tool as part of my development environment. 

svn log and svn diff are true life savers.  With svn log, I'm able to figure out who modified a file, when it was modified and the version numbers.  A basic svn diff helps when I want to go and commit my change to remind myself what I've done.  But I use both commands in conjunction to get a better idea of the history of a file.  For instance, your file can be up-to-date with the rest of the repository, but you still want to trace what changes have gone on to a file.  Using the revision number, you can execute a command like:

svn diff -r <from>:<to> <filename>

Then you can inspect all the changes.

Another really helpful command is svn revert.  Sometimes, you mess up a file and want to rollback quickly.  svn revert will do that trick nice and easy.  I think you can rollback to certain version numbers as well, but in the simplistic form, you can grab the last change made to that file in the repository (or the whole project if you're really screwed).

Probably my best friend of all these wonderful tools is the svn status command.  You can use svn st for short.  But it's a nice tool to help you discern what files have changed or need to be added.  At home, I've been fortunate enough to maintain my code in a Subversion repository,  However, sometimes I won't be able to touch it for a long period.  svn st helps me remember what I've done so I don't stumble too hard.

Prior to that, I would naively copy a file to something like <filename>.old, update that file alone, then run a diff -c or sdiff against both files.  That was too much work.  You really should just use the tools for the job.

Something I'm hoping to accomplish in the near future is figure out the export command.  There's a few other commands and techniques I'd like to learn, but just getting to this level has been great.

AddThis Social Bookmark Button Sphere: Related Content

Trackbacks: (Trackback URL)

No Comments Posted Yet
July [August] September
Sun Mon Tue Wed Thu Fri Sat
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3