I am running Subversion on Ubuntu. I have checked out the files for a project from an external server, done some changes on the files plus added some new files. Now I want to commit all the changes and the new files. However I modified the database configuration file to function with my local server so I don't want to commit that change as it will mess things up. Because I made a lot of changes and added many new files I don't want to commit the files one by one.
views:
434answers:
4What you should do is create a copy of the database configuration file, and load that instead. Basically, leave a canonical "standard" db config file in the repo, and have a localized config file that's based off the standard. Then set svn:ignore on your local copy so it doesn't get committed.
Use svn:ignore property to mark the files you do not want to version control.
If you have not already added the new files to subversion you will need to mark them as added first by executing the "svn add " command.
When you commit you can specify the files that you want to commit. You can use the shell features (glob matching, etc.) to specify multiple files that match certain patterns. There is no need to commit each file individually.
So you have two problems, one, that you want to ignore a file that you've changed and two, that you want to add a bunch of files to subversion at once.
To solve the first problem you should use the previous suggestion of:
svn propedit svn:ignore <dir>
and enter the name of the file into the editor that comes up (depending on the $EDITOR environment variable, this will most likely be emacs, vi, or nano by default). Make sure to save your changes to this file or it won't help.
To solve the second problem, just loop over the files in your working copy via svn add in a bash equivalent terminal emulator - it won't add something that's already under version control and you can safely ignore the warnings it gives you. The better solution would be to write a quick script to check if something is in svn first and only add it if it's not, but I think for what you're doing it might be a waste of time. So, just:
svn add *
from the root directory of your project and then, after checking svn status
to make sure you're happy with the changes, svn commit
. The commit command will find all your changes (minus the ones in svn:ignore) and send them off to your repository.