Edit 8/15/2012 – This is now available collected into a single ebook for your kindle. Only a buck. Version Control for Authors
Continuing the series talking about Version Control, and how authors can use it. It’s a big enough subject that I felt it best to split it into five uneven parts. I’ll update these to be links as each part is posted.
- Part I: What is Version Control and Why Should Authors care?
- Part II: Getting Started
- Part III: Get Your Stuff Back<- You are here
- Part IV: Questions & Tips
- Part V: Addendum
Part III: Get Your Stuff Back
Let’s say for whatever reason you need to dig in to your repository and find an old version of that one short story you wrote.
I’ll show you two ways to get at it. One is the shotgun approach. The other is the right way.
The Shotgun approach.
The shotgun approach is to just check out a copy of the full repository as it was at the version you are interested in.
This is useful if you’ve recently made a lot of changes that you want to undo, but isn’t the “right” way to get a single file.
Here’s what you do.
Commit and then erase your Fiction Working Directory. This is just to keep you from getting your wires crossed. You can check that last version back out using the same process when you’re done.
Create a new directory somewhere and go into it like we did when we were first setting things up. For this example, I’ll make a directory called “Old Version.” Once you are in your “Old Version” directory, right click and choose “SVN Checkout”. In the checkout screen, make sure you check the “revision” radio button.
Click the “Show log” button and choose which old version you want to get.
Then just click OK in the checkout window and you get your files installed to the directory you just created.
If you make changes and then commit while you are using this checked out version, those changed files will become the newest version that is stored in your repository. You may lose some that you previously made if you do this. (Lose, no. You will just end up with a most recent version that you don’t expect.) Hence the warning above.
The Right Way
The right way will usually be to just grab a copy of the file you want. For this, we’ll use a tool called the “Repo-browser”
To Launch the Repobrower, just go to your documents folder (or any windows explorer windows) and right click > TortoiseSVN > Repo-browser
Since you currently only have one repository, it should come already selected in the window that pops up. Just click OK.
Now you should be looking at the repo browser. In the Repo-browser, you are seeing the current version of files that are in your repository. In TortoiseSVN, the latest version is also known as the “HEAD.”
To find an old version, you need to click the button in the upper right that says “HEAD”
You can type in the number of the revision you want to browse, or if you don’t know it, click the “Show Log” button.
When selecting the version you want to look at, take notice of the “Message” column. If you add a good message when you check in, this column will be very helpful in finding the version you want.
Click “OK” a couple of times and you’ll be back at the main repo-browser window, but now you’ll be looking at the files and folders from the version you just selected.
From here you can navigate the files and folders just like you would in your regular windows file explorer. You can drag and drop the files that you see onto your desktop.
Well, that should give you the basics of using TortoiseSVN to keep track of your fiction writing. Pat yourself on the back.
But don’t go anywhere, I’m not finished yet.
Next time I’ll answer a few questions and maybe give you a few ideas for working with your repository in the real world.