![]() |
|||||||||||||||||||||||||||
| This website is not maintained anymore. Please visit www.nerdgirl.dkinstead | |||||||||||||||||||||||||||
|
This page was last modified: July 27 2010 13:22:12 | ||||||||||||||||||||||||||
Subversion - commandsDeleting a fileHere I have a file I need to delete...
ls -1 svn delete immediatly removes a file from both the repository and the filesystem, but a directory is not removed until you issue the svn commit command. List of changesIf you run svn status at the root of your working copy with no arguments, it will detect all file and tree changes you've made. Add new files and directoriesAdd a directory and it's contents: svn add my_dir If svn complains and tells you that the directory is already under version control, it's because the directory you're trying to add contains a .svn directory. I experienced this once, because the new directory I added, was a copy I made of an existing directory. So I just needed to remove the .svn folders within the new directory. Add a directory without it's contents: svn add --non-recursive my_dir Add a new file svn add my_file.txt Add everything new, recursively. Go to the root of the working copy and do... svn add * --force Any svn add command must be followed by a svn commit. You can of cause do multiple svn add commands before committing. Making changesOpen the file and make your changes, then do a commit: svn commit filename -m "This is why I did the change" You can also make changes to multiple files and then do: svn commit -m "Changes done on multiple files...bla, bla" Make sure you are in the root of the project when committing multiple changes. If your are in a subdirectory, only changes done within that directory is committed. Ignoring files and directoriesIgnore every file ending with '.log' in the log dir. svn propset svn:ignore "*.log" log Ignore all files in the log dir and the statistics dir
svn propset svn:ignore "*" log ProceduresQuote from the subversion book: For projects that have a large number of contributors, it's common for most people to have working copies of the trunk. Whenever someone needs to make a long-running change that is likely to disrupt the trunk, a standard procedure is to create a private branch and commit changes there until all the work is complete. Subversion has no internal concept of a branch-only copies. When you copy a directory, the resulting directory is only a 'branch' because you attach that meaning to it. You may think of the directory differently, or treat it differently, but to Subversion it's just an ordinary directory that happens to have been created by copying. For example, let's say that Joe is starting a coding project scheduled for one month. Mary and Peter are currently correcting small bugs in the trunk. To prevent Joes project from interfering with Marys and Peters work, a branch is created for Joe:
svn copy file:///usr/local/www/subversion/nerdgirl.dk/trunk \ With an interval of 7 days, changes from the trunk (Mary and Peters bug fixes) should be merged into Joes branch. This will prevent major problems when the time comes to merge joes_branch with the trunk, since it already contains all the changes made to the trunk. This is how to merge changes from the trunk to a working copy of the branch (you must be sitting in the parent directory of your working copy when doing this)
svn merge -r 343:344 file:///usr/local/www/subversion/nerdgirl.dk/trunk joes_branch In the above example, all changes done between revision 343 and 344 in the trunk, is merged into the branch. It is omportant to make a note of which changes you have merged. Next time you want to do a merge, you'll know which revision is already merged. This way you can prevent conflicts which is bound to happen if you merge the same changes twice. BackupThe svnadmin dump PATH_FROM_REP > PATH_TO_FILE command writes data into a single, portable, flat file format. Example of a full repository dump and load:
svnlook youngest /path/to/myrepos/ Example of incremental dump and load:
svnadmin dump myrepos --revision 0:1000 > dumpfile1 |
|||||||||||||||||||||||||||