Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add File to SVN without Checking out

Tags:

svn

I would like to add a file to a remote svn repository without checking out the project.

svn add requires the project to be checked out

svn import seems to only import directories

Any ideas?

like image 272
Brig Avatar asked Oct 22 '10 20:10

Brig


People also ask

How do I add files to svn?

Adding a File or Directory To add an existing file to a Subversion repository and put it under revision control, change to the directory with its working copy and run the following command: svn add file… Similarly, to add a directory and all files that are in it, type: svn add directory…

How do I add an existing project to a svn repository?

Open your project folder. You will see question marks on folders that are associated with your VS project that have not yet been added to Subversion. Select those folders using Ctrl + Click, then right-click one of the selected items and select TortoiseSVN > Add. Select OK on the prompt.


2 Answers

I think it got it. The secret is to include the file name on the url

svn import -m "Adding just a file" file_name http://path/to/svn/repo/file_name 
like image 133
Brig Avatar answered Sep 29 '22 22:09

Brig


You should be able to use svn import:

$ svn help import import: Commit an unversioned file or tree into the repository. 

Import is able to add individual files and trees to a repository.

like image 45
Sander Rijken Avatar answered Sep 29 '22 23:09

Sander Rijken