Svn propedit command6/14/2023 ![]() ![]() Many other version control systems, specifically RCS, and the systems built on top of them, such as Perforce and CVS, don’t make it easy to do this. ![]() Copying and Moving Versioned ItemsĪdding a file or directory to your version control system isn’t all that interesting, but where Subversion really shines is in its ability to copy and rename files and directories, while still retaining their revision history. If you don’t want to add all of the directory’s contents, you can pass the -non-recursive flag to svn add, and only the top-level directory will be scheduled for addition. If you created the directory before you decided to add it, then a regular svn add will schedule it, and all of its contents, for addition. Simply run svn mkdir DIRNAME, and it will create the new directory and schedule it for addition when you next commit, all in one step. ![]() If you’re adding a new directory, there’s no need to create and add it in two steps, because you can use Subversion’s svn mkdir command, which you used earlier to create directories in the repository, in the working copy as well. You then commit the change, adding Makefile to the repository, and the final svn status -v shows it as any other versioned file. Next, you run svn add Makefile, and Makefile is scheduled for addition, which you can see from the output of the second svn status, where the first column is an A. The first svn status has a ? in the first column of the line about Makefile, which means that Makefile isn’t currently under Subversion’s control. So again, you have some new output to interpret. This schedules the file for addition, and later you can run svn commit to complete the process. It works just as you would expect: You check out a working copy, create the file (or directory), and run svn add FILENAME. Sooner or later, you’re almost certainly going to want to add some new files or directories to your Subversion repository, so you’ll have to become familiar with the svn add command. This next section covers the commands that let you make changes to those tree structures, by adding, copying, renaming, and deleting files and directories. But if you recall, Subversion doesn’t just version files contents, it versions tree structures. So far we’ve mainly seen commands associated with making changes to the contents of files and committing them to the repository. Well, you’ve learned the basics, the Subversion commands that fill 90% of your day to day routine, but sooner or later you’ll need to hit that last 10%, so let’s get on with it. Editor’s Note: This piece picks up where the article A Crash Course in Subversion left off.] Adding, Copying, Renaming, and Removing Files ![]()
0 Comments
Leave a Reply. |