问题
I have a poject that has thousands of files. I made some changes that affected almost half of the files. the changes included editing existing files and adding new files and directories.
I need to revert all these changes and restore the project to how it was. I have created a tag before doing all this but I am not sure how I can restore the whole project from the tag
回答1:
This is unfortunately the kind of thing that CVS is particularly not good at.
I do not believe that you can lose the history of your big commit (*) but rather you want to commit the reverse of your original changes (a revert
in some SCM's terminology).
I recommend using non-CVS tools to determine what needs to be done and then just do the commits in CVS.
- Have two workspaces checked out. One checked out to the branch/HEAD and the other checked out to your tag.
- Create lists of files in each workspace and do the appropriate diffs (not
cvs diff
, just regulardiff
orcomm
or whatever you want for this) to get three lists: files you now need to Add and Delete. - Do some diffs to find out what files you need to modify.
cvs add
the files that need adding. (Not sure if-kb
is necessary when re-adding a file, probably not, but I'm not certain.)cvs rm
the files that need deleting.- Copy over the ones that need modifying and
cvs commit -R
them all at once.
If you have a log file that contain the details of your original big commit, you could also use that to create your list of add/delete/modify commands.
(*) Well, you could probably one-by-one use cvs admin
to remove the new file versions, but I do not think that is advisable at all.
来源:https://stackoverflow.com/questions/46347941/how-can-i-revert-a-whole-project-to-an-earlier-tag-in-cvs