Thursday, June 02, 2005

Checking binary files in CVS

Its easy adding and checking-in text files in CVS. Use the following commands:
cvs add [filename]
cvs commit [filename]

And when you want to add and commit it in binary format in CVS. Use the following commands:
cvs add -kb [filename]
cvs commit [filename]

But, what if you add an binary executable file in text format (like I always do). You are in a big mess. I always used to delete that file from CVS and add the same file again in binary mode. However, I recently came to know that we can change the mode from text to binary using 'cvs admin' and 'cvs update' commands.

What you have to do is:
1. Replace the existing file in your local folder with a clean binary version. (I still want to verify whether this is necessary or not)
2. Call cvs admin -kb [filename]
3. Call cvs update -A [filename]

This converts the file in binary mode. This has saved a lot of my time, and also the version number isn't altered.
Reference:
Click here to goto reference page

Other CVS links (CVS tutor):
http://durak.org/cvswebsites/doc/cvs_toc.php#SEC_Contents

No comments: