How do you add a folder without version control to a specific SVN location? I often start writing code and only after I have a few folders containing code files do I add it to SVN.
What I usually do is:
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…
Moving files and folders select the files or directories you want to move. right drag them to the new location inside the working copy. release the right mouse button. in the popup menu select Context Menu → SVN Move versioned files here.
The easiest way to copy files and folders from within a working copy is to use the right drag menu. When you right drag a file or folder from one working copy to another, or even within the same folder, a context menu appears when you release the mouse.
Let's say I have code in the directory ~/local_dir/myNewApp
, and I want to put it under 'https://svn.host/existing_path/myNewApp' (while being able to ignore some binaries, vendor libraries, etc.).
svn mkdir https://svn.host/existing_path/myNewApp
cd ~/local_dir
svn co https://svn.host/existing_path/myNewApp
. If your folder has a different name locally than in the repository, you must specify it as an additional argument.svn st
will now show all your files as ?
, which means that they are not currently under revision controlsvn add
on files you want to add to the repository, and add others to svn:ignore
. You may find some useful options with svn help add
, for example --parents
or --depth empty
, when you want selectively add only some files/folders.svn ci
If I correctly understood your use case, I suggest to try using svn add to put the new folder under version, see here. The following will add the new folder with files recursively under version control (if you are inside valid working copy):
svn add new_folder svn commit -m "Add New folder to the project"
If you are not in a working copy, create it with svn checkout, copy new_folder there and do the above steps.
OR
Try svn import, see here; the following will create a new folder and upload files to the repository:
svn import -m "Import new folder to the project" new_folder \ http://SVN_REPO/repos/trunk/new_folder
Also note that:
After importing data, note that the original tree is not under version control. To start working, you still need to svn checkout a fresh working copy of the tree
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