After quite a few requests by people to use the SVK Tutorials for various things, I’ve decided to license them under the Creative Commons Attribution-ShareAlike license. This license includes commercial use of the works.
After all the work I did seeking permission to play independent music on the podcast, and finding it so much work given an already busy schedule, I realized that I’m actually causing the same level of frustration for people when it comes to the tutorials. Obviously people have found them useful enough to ask to use the content — and I never say no — so why make it such a difficult process?
I’m really glad that these have been useful to people and it makes perfect sense to me to release them on this license.
So have fun with them and stop asking me for permission to use them. 😉
Kato Atsushi is making Japanese translations of the SVK tutorials available. These are a work in progress. Part I is up so far. Thanks Kato!
Ken Underwood has put together a very simple “listening to podcasts HOWTO” in both printable and screen resolution PDF. For those of you who want a simple set of instructions to get your family and friends into podcasting, check out the Podcasting 101 links in the “Getting Started” section over on this page.
Wellie Chao has published a four page Subversion tutorial on the devx.com web site.
It’s an extremely high level tutorial that doesn’t get into a whole lot of detail, but useful for the beginner just starting out.
As I’m beginning to talk to people about the SVK version control tool more, I’m noticing that the concept of mirroring isn’t as obvious to some people as it was to me when I started messing around with it (or maybe I just choose not to remember how unobvious it was), so I thought I would take some time to try to explain some of the concepts at an extremely high (and hopefully easier to understand) level.
Sometimes the best way to explain a concept is with a picture, so I threw together this small data flow diagram that shows the flow of data through the SVK system and what commands cause this data transfer to happen.
The basic high level workflow of an SVK session looks like this:
- Create A Mirror
You mirror the repository using the svk mirror command. For me, I find it easiest to create my mirrors at the topmost level (for example, a mirror of the bieberlabs trunk might be at //bieberlabs/trunk).
- Synchronize Your Mirror
This brings down the revisions that you do not have yet in your main (and remote) repository to your newly established mirrored path.
- Create a Local Branch To Do Your Work
Many times I see that people default to checking out from the actual mirror (in the above example, //bieberlabs/trunk). This will work, but you lose the whole beneifit of SVK. If you check out of a mirror, every commit you make will be synchronized back to the main repository. This is not desired behavior most of the time. So, create a local branch first. I like to create a top level directory in the repository called //local that I put my local branches in, just so I know where to find them.
- Periodically synchronize your mirror and merge those changes into your local branch
This is where all of the power is. You now have a local branch that you can keep completely up to date with the repository that others are doing work in. Using the svk smerge command, you can merge changes from //bieberlabs//trunk to //local/mychange as you synchronize your mirror. This allows you to always be working on the current code. You can commit your work and not effect anyone else working in the repository until you are ready to merge into the mirror.
- Once you have merged changes to your local branch, update your workarea
A common misunderstanding when you smerge into your local branch is that the changes appear magically in your workarea. This is not the case. Remember, when you are smerging you are working in the repository. You still have to update your workarea (and possibly resolve conflicts) from the repository in order to reflect your changes.
- Merge your branch back into the mirror
Once you have finished your change, tested and committed (probably multiple times), you can now smerge your branch back into the mirror. When you perform this merge, the changes will be moved to the source repository and subsequently synced to your mirror (the line in the diagram is red to signify this). Once this happens, all of your changes are visible to everyone else, in one commit.
Here’s the nice thing about working like this. When merging back and forth, you are not searching for ranges of revision numbers to merge. SVK remembers each merge done, so you can use your local branch forever, because you can constantly keep it up to date. This gets rid of the “make a branch, change the branch, merge the branch , delete the branch” cycle and allows you to have one place to work all of the time.
I hope that this really high level view gives a better understanding of the workflow surrounding using SVK and illustrates very simply the advantages of the tool.
For a step by step walk through the tool, you can go through the SVK tutorials.
I’m getting some positive feedback on the set of SVK tutorials that I wrote a few weeks back. Thanks to everyone sending comments and commenting on them on your blogs. It’s really encouraging to know that something you have worked through and written down has been helpful to other people in investigating a really useful tool.
Keep the feedback coming.
As an aside, there is a great article on perl.com about SVK that was written by the tools author. Well worth the read.