views:

62

answers:

3

How do I upload a single file from my local computer to a SVN repository?

I can import a directory, but I can't import a single file into existing directory.

I use SVN in linux (command line).

Any help would be appreciated.

Edit: I forgot to mention, I need to upload this file into a specific directory that has nothing to do with directory structure in my local computer (say I upload from Desktop).

So I want to upload a file from Desktop to https://.../somefolder

A: 

svn add filename svn commit filename

shk
A: 
svn add /path/to/your/file.txt
svn ci /path/to/your/file.txt -m "This is where the message goes"

Or if you havn't added anything else just commit with

svn ci -m "Your message"
Keyo
+5  A: 

Well, short answer is that it doesn't work like that :) In SVN you work with a checked-out revision of your repository. In order to "upload a single file" you have to "add" the file with "svn add foo.txt" and then run "svn commit -m "Added file foo" foo.txt". But you can only do this to an existing repository. Therefore you must first checkout the revision (rev of trunk or a given branch) of the repository to add the file to. So the entire steps would be something like

After this you can delete your local copy again.

inquam
Thank you. But you probably ment 'svn ci' (commit) in the last line?
yper
you're very right indeed ;)
inquam