====== CVS Notes ====== * [[http://commons.oreilly.com/wiki/index.php/Essential_CVS|Essential CVS]] (free online book) * [[http://commons.oreilly.com/wiki/index.php/Essential_CVS/CVS_Quick_Reference|CVS Quick Reference]] ===== .cvsrc File ===== Common ''.csvrc'' settings: cvs -q update -dP diff -uN ===== Branches ===== ==== Create a new Branch ==== Creating a branchpoint from something other than head: cvs rtag -r cvs_project_name then cvs rtag -b -r cvs_project_name e.g. cvs rtag -r MYPROJECT_1_2 MYPROJECT_1_2_BP myproject cvs rtag -b -r MYPROJECT_1_2_BP MYPROJECT_NEW_WORK_BR myproject or just cvs rtag -b -r MYPROJECT_1_2 MYPROJECT_NEW_WORK_BR myproject ==== Update a Branch from HEAD ==== To update a branch with the latest from HEAD: cvs update -j HEAD ==== Merge from a Branch to HEAD ==== cvs update -dj ==== Merge from a Branch to another Branch ==== Merging a project branch to HEAD: * place an end point (EP) tag on project branch * update target branch (or HEAD), and optionally set a pre-merge tag * go to target branch (or HEAD) root * ''cvs update -dj -j '' Assuming a branch point tag (ordinary tag) has been created: cvs update -dj -j Examples: cvs update -dj MYPROJECT_BP -j MYPROJECT_1_3 cvs update -P -dj MYPROJECT_1_2 -j MYPROJECT_1_3 If no branch point tag (ordinary tag) has been created (at target root): cvs update -j Example: cvs update -j MYPROJECT_BR To do a run through without making changes use -n: cvs -n update -dj -j To prune empty directories: cvs update -P -dj -j cvs update -P -dj MYPROJECT_BP -j MYPROJECT_EP To ignore $id$ tag differences use the -kk option: cvs update -P -kk -dj MYPROJECT_BP -j MYPROJECT_EP But this creates a sticky tag situation //if you're on HEAD//, so you need to then remove the sticky tag: cvs update -A ==== Remove a Branch ==== Note: only do this if it was just created and there has been no activity on it! cvs rtag -d -B cvs_project_name ===== Diffs ===== ==== Diff Two Tags ==== cvs diff -u -r -r or cvs diff -u -r MYPROJECT_1_2 -r MYPROJECT_1_3 ==== Changes made in Branch ==== Requires a branch point tag to compare against (-kk: ignore CVS id tags). List files changed (rdiff -s: summary change report): cvs -q rdiff -s -kk -r MYPROJECT_BP -r MYPROJECT_BR myproject cvs -q rdiff -s -kk -r MYPROJECT_VERSION_1 -r MYPROJECT_VERSION_2 myproject cvs -q rdiff -s -kk -r MYPROJECT_VERSION_1 -r MYPROJECT_VERSION_2 myproject/folder List files and changes: cvs -q rdiff -u -kk -r MYPROJECT_BP -r MYPROJECT_BR myproject Details on one file: cvs -q rdiff -kk -r MYPROJECT_VERSION_1 -r MYPROJECT_VERSION_2 myproject/folder/file.ext