Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import files directly to SVN repo without checking out first

Tags:

bash

svn

I am using SVN and have a repository on a remote machine. Sometimes, when working on my local machine I realize that I need to add some new files to the repo. The usual procedure I know would then be:

  1. at the current folder on my local machine checkout the whole SVN repo
  2. enter there
  3. copy the interesting file here
  4. commit

But this can be a bit tedious. I wonder if somehow, I can omit steps 1 to 3 and import the "interesting" file to SVN directly without necessity of checking out the repo first?

like image 299
Open the way Avatar asked Mar 12 '10 08:03

Open the way


People also ask

How do I import files into SVN repository?

In order to place your project under version control you will need to import your existing files and folders into your Subversion repository: Use the repository browser to locate and select the folder into which your files should be imported. Select the File > Import… menu item.

How do I checkout a specific file in SVN?

If you just want to export the file, and you won't need to update it later, you can do it without having to use SVN commands. Using TortoiseSVN Repository Browser, select the file, right click, and then select "Copy URL to clipboard".

How do I move files in SVN without losing history?

If you right-drag the folder and use "SVN move versioned item(s) here", then you keep the history. Even the history of the files within the folder.


2 Answers

Perhaps svn import is what you want ? Check the documentation for details.

like image 66
High Performance Mark Avatar answered Oct 22 '22 21:10

High Performance Mark


You can checkout only the folder where the new files go, add the new files and commit.

Seems to me like what you're doing is dangerous. If you don't update from SVN first and re-compile the code, you might be introducing bugs or break the build. Maybe the interface of that class you're using has changed in the repository!

like image 2
Warpin Avatar answered Oct 22 '22 23:10

Warpin