$ cd
$ svnadmin create SVN_REPOSITORY # create folder SVN_REPOSITORY in $HOME
$ echo `pwd`/SVN_REPOSITORY # /data/home001/dxu/SVN_REPOSITORY
2. Add stuff into the repository
# check out the empty repository
$ svn co file:///data/home001/dxu/SVN_REPOSITORY my_reps
$ cd my_reps
$ mkdir dir1 # create a folder dir1
$ svn add dir1 # add dir1 into svn repository
$ svn commit -m "" dir1 # commit the change into svn
3. How to use svn copy
Note: File bar.txt must NOT exist, otherwise, get error like
svn: Path 'bar.txt' is not a directory
$ svn copy foo.txt bar.txt
A bar.txt
$ svn status
A + bar.txt
OR
$ svn copy file:///tmp/repos/test/foo.txt bar.txt
$ svn copy near.txt file:///tmp/repos/test/far-away.txt -m "Remote copy."
$ svn copy file:///tmp/repos/test/far-away near-here A near-here
And finally, copying between two URLs:
$ svn copy file:///tmp/repos/test/far-away file:///tmp/repos/test/over-there -m "remote copy."
This is the easiest way to “tag” a revision in your repository—just svn copy that revision (usually HEAD) into your tags directory.
$ svn copy file:///tmp/repos/test/trunk file:///tmp/repos/test/tags/0.6.32-prerelease -m "tag tree" Committed revision 12.
And don't worry if you forgot to tag—you can always specify an older revision and tag anytime:
$ svn copy -r 11 file:///tmp/repos/test/trunk file:///tmp/repos/test/tags/0.6.32-prerelease -m "Forgot to tag at rev 11"
Committed revision 13.
Copy a file with specific version
1) Either way is ok to specify a specific version
2) File abc / def must NOT exist before copy.
[dxu@orbit272l ssmis_bufr]$ svn copy main_read_ssmis.f90@146 abc
A abc
[dxu@orbit272l ssmis_bufr]$ svn copy -r146 main_read_ssmis.f90 def
A def
[dxu@orbit272l ssmis_bufr]$ diff abc def
[dxu@orbit272l ssmis_bufr]$
Compare different versions of a file
$ slog main_read_ssmis.f90 ## find all versions
$ svn diff -r 145 main_read_ssmis.f90 ## comp local v.s. r145
$ svn diff -r 146:145 main_read_ssmis.f90 ## comp r146 v.s. r145
View different versions of a file
$ scat main_read_ssmis.f90 ## find all versions
$ svn cat -r145 main_read_ssmis.f90 |less ## view r145
$ svn cat main_read_ssmis.f90@145 |less ## view r145
No comments:
Post a Comment