Difference between revisions of "SVN"
(→Examine your changes) |
(→Make changes) |
||
Line 22: | Line 22: | ||
− | ==Make changes== | + | ==Make changes to your working copy== |
− | + | <pre>svn add filename1.c</pre> | |
− | + | *To add file to repository after you <b>commit</b> | |
− | |||
− | |||
+ | <pre>svn delete filename1.c</pre> | ||
+ | *To delete file from repository and your working copy after you <b>commit</b>: | ||
+ | |||
+ | <pre>svn copy item1 item2</pre> | ||
+ | *To create a new item item2 as a duplicate of item1. When item2 is added to the repository on the next commit, its copy history is recorded. | ||
+ | |||
+ | :<pre>svn move item1 item2</pre> | ||
+ | *item2 is scheduled for addition as a copy of item1, and item1 is scheduled for removal. | ||
==Examine your changes== | ==Examine your changes== |
Revision as of 19:35, 22 October 2006
Contents
Branch Maintenance
Repository layout:
- trunk directory - "main line" of development
- branches directory - branch copies
- tag directory - tag copies
SVN commands
The typical work cycle will use the following commands:
Update your working copy
- When working on a project with a team, you'll want to update your working copy to receive changes made by other developers since your last update
$svn update U filename1.c U filename2.c Updated to revision 2.
- U <filename> - file was updated (received changes from the server)
Make changes to your working copy
svn add filename1.c
- To add file to repository after you commit
svn delete filename1.c
- To delete file from repository and your working copy after you commit:
svn copy item1 item2
- To create a new item item2 as a duplicate of item1. When item2 is added to the repository on the next commit, its copy history is recorded.
svn move item1 item2
- item2 is scheduled for addition as a copy of item1, and item1 is scheduled for removal.
Examine your changes
- svn status
- After you've made changes, it's a good idea to take a look at exactly what you've changed before committing them to the repository.
$svn status
- This will detect all file and tree changes you've made
- By passing a specific path, you will get information about that item alone:
$svn status stuff/filename3.c D stuff/filename3.c
- D <filename/directory> - File or directory was deleted from your working copy
- A <filename/directory> - File or directory was added to your working copy
- R <filename/directory> - File or directory was replaces in your working copy
- G <filename> - File received new changes from repository but your local copy of the file had your modifications
- C <filename> - File received conflicting changes from the server
svn diff
svn revert
Merge other's changes into your working copy
svn update
svn resolved
Commit your changes
svn commit
More commands
- Compare changes from one revision to another:
svn diff --revision 1:4 filename1.cpp
- This example allows us to see what's changed between the first and fourth revision of the filename1.cpp file.
- For a complete guide: http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.diff.html