CVS Repository Tips

by Francis 2013-03-28 19:18:39

1. Adds a file to the repository
cvs add file.php

2. Updates a file in the repository
cvs update -A file.php
// The -A tag reminds you to 'commit' the file

3. Commits a file or sends it to the repository
cvs commit -m "added new variables" file.php
// The -m switch is to add a message to the file

4. Remove a file from the repository
cvs remove file.php

5. Show you the 'log' for a file
cvs log file.php

6. The difference in versions of files in a cvs repository
// To get diff between versions 1.1 and 1.2
cvs diff -r 1.1 -r 1.2 file.php

// A file locally and you want to see a differences between your copy and the repository's copy
cvs -Q diff -c file.php

// You have got enscript installed, you can get what I call a 'pretty' diff
cvs -Q diff -c file.php | enscript -Ediff -o

// Output a nice printable file in Postscript format with the differences marked in bold
get locally modified

// You forget to check in your changes
cvs -f status *.php | grep 'Status: Locally Modified'

7. Revert to previous version
cvs update -r 1.3 file.php

8. Status of directory
cvs -f status -v my_project/ > status_project_'date +%Y-%m-%e'

9. Update directory
cvs -q update -d my_project/sql

10. Change default CVS editor
export CVSEDITOR=/usr/bin/emacsclient
// Add more editors if you like, .bashrc

Tagged in:


You must LOGIN to add comments