CVS Merging Instructions

0 +

I wish I could take credit for this information, as it's really smart, and has helped me already thanks to @cpliakas for pointing out the original link on a crappy geocities site that is now down due to the death of geocities. If you are the original author of this information, let me know, and I'll gladly throw a link to your new site!

How to Change a File in the Branch

Check Out Branch $ cd ~/work-rel-3-0 $ cvs co -r rel-3-0 java

...do your changes to the branch...

Commit your changes to the branch

$ cvs update [file-name]

$ cvs commit [file name]

NOTE: the update and commit commands don't need the -r option. They know you are working in the branch.

How To Merge Branch Changes back to the Main Trunk

Check Out Main Trunk

$ cd ~/work

$ cvs co java

Merge the branch changes back to the Trunk

$ cvs update -j rel-3-0 [file name]

$ cvs commit [file name]

NOTE: the update command is "joining" the rel-3-0 branch into the current copy of the file.

To Merge Changes from the Main Trunk to the Branch

Commit your changes to the main trunk as normal.

Check Out the Branch

$ cd ~/work-rel-3-0

$ cvs co -r rel-3-0 java

Join the changes from the main trunk into the branch

$ cvs update -j HEAD [file name]

$ cvs commit [file name]

NOTE: the update command is "joining" from the HEAD of the main trunk into the current copy of the file. HEAD is a keyword used by CVS.

 

Useful Commands

How do I tell if I checked out a branch or the main trunk?

To Determine if you are working on a branch or the main trunck, run the following command

$ cvs status [file name]

The "Sticky Tag" field will tell you whether the file you specified is on a branch or not. It will say "none" if it's on the main trunk.

How do I see which files have been modified?

Run the following command:

$ cvs -q -n update

This will show you which files have been changed in your current directory (and all subdirectories) without actually updating any files. The -n option to cvs always shows you the output from a CVS command without actually performing the command. The -q option stands for "quiet" and makes the output less verbose.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <h2> <h3> <h4> <h5> <h6> <img> <p>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Twitter-style @usersnames are linked to their Twitter account pages.

More information about formatting options