Adding new files to a subversion repository
- Checkout a working copy of the repository (or at least the subdirectory that you want to add the files to):
svn checkout https://example.org/path/to/repo/bleh
- Copy the files over there.
svn add file1 file2...
svn commit
I am not aware of a quicker option.
Note: if you are on the same machine as your Subversion repository, the URL can use the file:
specifier with a path in place of https:
in the svn checkout
command. For example svn checkout file:///path/to/repo/bleh
.
PS. as pointed out in the comments and other answers, you can use something like svn import . <URL>
if you want to recursively import everything in the current directory. With this option, however, you can't skip over some of the files; it's all or nothing.
Probably svn import
would be the best option around. Check out Getting Data into Your Repository (in Version Control with Subversion, For Subversion).
The svn import command is a quick way to copy an unversioned tree of files into a repository, creating intermediate directories as necessary. svn import doesn't require a working copy, and your files are immediately committed to the repository. You typically use this when you have an existing tree of files that you want to begin tracking in your Subversion repository. For example:
$ svn import /path/to/mytree \ http://svn.example.com/svn/repo/some/project \ -m "Initial import" Adding mytree/foo.c Adding mytree/bar.c Adding mytree/subdir Adding mytree/subdir/quux.h Committed revision 1. $
The previous example copied the contents of the local directory mytree into the directory some/project in the repository. Note that you didn't have to create that new directory first—svn import does that for you. Immediately after the commit, you can see your data in the repository:
$ svn list http://svn.example.com/svn/repo/some/project bar.c foo.c subdir/ $
Note that after the import is finished, the original local directory is not converted into a working copy. To begin working on that data in a versioned fashion, you still need to create a fresh working copy of that tree.
Note: if you are on the same machine as the Subversion repository you can use the file://
specifier with a path rather than the https://
with a URL specifier.