CVS Best Practices: Difference between revisions
Wikify'd |
Added renaming section |
||
Line 4: | Line 4: | ||
b_XYZ_descriptive | b_XYZ_descriptive | ||
where <code>XYZ</code> are your initials and <code>descriptive</code> is a descriptive name for your branch. | where <code>XYZ</code> are your initials and <code>descriptive</code> is a descriptive name for your branch. | ||
'''Note''': Branches and branch tags are essentially ''immutable''. Once you make one, that branch is there. | |||
==Branching files== | ==Branching files== | ||
''Note'': With GEOS-5 we do not branch the entire model. Rather we branch individual files that are edited. There may be special circumstances when branching an entire directory (say, a leaf Gridded Component) might be correct, but this should only be done with approval. | '''Note''': With GEOS-5 we do not branch the entire model. Rather we branch individual files that are edited. There may be special circumstances when branching an entire directory (say, a leaf Gridded Component) might be correct, but this should only be done with approval. | ||
To branch your modified file on a new branch, assume you've made modifications to file.F90 and want to save these to a new branch of the model. To do so: | To branch your modified file on a new branch, assume you've made modifications to file.F90 and want to save these to a new branch of the model. To do so: | ||
Line 56: | Line 58: | ||
cvs tag my-tag-name file.F90 | cvs tag my-tag-name file.F90 | ||
cvs update -r my-tag-name file.F90 | cvs update -r my-tag-name file.F90 | ||
==Renaming tags== | |||
With CVS it is fairly simple to rename a tag ''''that is not a branch tag'''''. Assume you have two tags, a <code>bad_tag</code> name you wish to change to a new <code>good_tag</code> name. First, tag all files that have the old tag with the new tag relative to that tag: | |||
$ cvs tag -r bad_tag good_tag file1.F90 file2.F90 file3.F90 | |||
T file1.F90 | |||
T file2.F90 | |||
T file3.F90 | |||
Then remove <code>bad_tag</code> from those files: | |||
$ cvs tag -d bad_tag file1.F90 file2.F90 file3.F90 | |||
D file1.F90 | |||
D file2.F90 | |||
D file3.F90 |