cvs checkout - how do I get a snapshot of a CVS repository on a certain date?

CVS checkout FAQ: How do I get a snapshot of a CVS repository back to a certain date?

To solve your first problem, let's assume that yesterday was September 14, 2001, and your project name was KickStart. To check out the code from your KickStart repository from late last night, use this cvs checkout (cvs co) command:

cvs co -D "2001-09-14 23:59:59 GMT" KickStart

Now your working version will reflect the state of the repository from one second before midnight last night, Universal Coordinated Time (also known as "Greenwich Mean Time").

cvs checkout command - why specify the date?

Followup question: "Why did you have to specify the time and 'GMT' with that CVS checkout command? Wouldn't I automatically get the correct copy of the repository just by specifying the date?"

No you wouldn't. If you had just specified the date, like this CVS checkout command:

cvs co -D "2001-09-14" KickStart

you would have checked out a version of the repository that essentialy began the day, 2001-09-14. According to the CVS book "Open Source Development with CVS", the date 2001-09-14 is interpreted as "the midnight that begins 2001-09-14", so you would only have the code that began that day. That can be a big difference.

The "GMT" is specified because that is how the CVS repository stores date/time information. Because people around the world may be working on a given project, this is a good way to keep the date/time consistent. However, it also means you must be aware of this when you want to go back to a previous revision by specifying the date.


Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.