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.
Right Click the new repo and choose SVN Repo Browser. Right click 'trunk' Choose ADD Folder... and point to your folder structure of your project in development. Click OK and SVN will ADD your folder structure in.
Edit These files exist in a directory tree so adding * for one directory will not work. @your edit: So then provide multiple paths to add like: svn add dir1/* dir2/* dir3/* or as many have mentioned grep the ouput of svn stat from the root and pipe it to cut or awk and then to add.
To import a project into the repository, right click the project you want to import and select Team > Share Project... from the context menu. This will begin the Share Project wizard. Select SVN as the repository type and click Next.
svn checkout https://example.org/path/to/repo/bleh
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With