Musings of an anonymous geek

March 8, 2007

Rolling Back an Entire CVS Repository

Filed under: Technology — m0j0 @ 11:14 am

There’s someone at Stanford who maintains a whole bunch of awesome tips on using CVS. This is perfect for me because it has all the little things that my brain loses because I don’t need to use CVS all that frequently. Of course, not using it frequently also leads to screwups, and I has a doozy this week. I thought I was joining two branches in the *checked out* version of my repository. What I really did was merge the two branches onto HEAD somehow. If you’ve ever done this, there’s a route out of the maze, and that doc from Stanford has it. I’m reproducing it here in case that document ever moves or goes away:

Here is what you need to do if you want to revert the changes in you repository back, say, two days:
1. Make sure you are up to date

% cvs update

2. Create a tag based on the date. The -D can be any date format that CVS will reconize.

cvs tag -D "2 days ago" two_days_ago

3. Clear the sticky bits. (Don’t Ask)

cvs update -A

4. Do the reverse join. (Again, don’t ask…or… you can see the CVS documentation!)

cvs update -j HEAD -j two_days_ago

5. Update after you do the join.

cvs update

6. Commit the changes.

cvs commit

And that’s it!!! You’re saved! You’re back to a good, working version.

Phew!

That one saved my bacon. Now I can get on with the work of moving this project (and the rest of my development) to GIT!!

Technorati Tags: , , , , , , , , , , , ,

Social Bookmarks:
About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 69 other followers

%d bloggers like this: