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: cvs, coding, development, documentation, tips, git, open-source, floss, unix, linux, scm, vcs,