I have some files on my local Unix machine that need to be added to a Subversion repository (access via HTTPS). How do I do this?
Doing svn commit in the directory just says it's not a working directory.
I have some files on my local Unix machine that need to be added to a Subversion repository (access via HTTPS). How do I do this?
Doing svn commit in the directory just says it's not a working directory.
svn checkout https://example.org/path/to/repo/blehsvn add file1 file2...svn commitI 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.
svn import accepts only a single path argument. To be honest, though, I did not know back then that svn import could be used with an already populated repository. In any case, thanks for pointing this out!--force option for svn import... no guarantees, though. I don't use SVN myself. My guess is that this simply isn't supported/allowed - so if it doesn't work, you're going to have to ask the SVN folks for the reason.checkout to create a working set, then update the working set, then do a commit, you are working with Subversion merge rather than against it. If the repository is empty then an import should be fine or you are creating a new folder in an existing repository where the content is going.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.
To add a new file in SVN
svn add file_name svn commit -m "text about changes..." To add a new file in a directory in SVN
svn add directory_name/file_name svn commit -m "text about changes" To add all new files in a directory with some targets (files) are already versioned (added):
svn add directory_name/* svn commit -m "text about changes" Before you can add files in an unversioned directory, you have to add the directory itself to the versioning:
svn add directory_name will add the directory directory_name and all sub-directories: http://svnbook.red-bean.com/en/1.8/svn.ref.svn.c.add.html