Sie sind auf Seite 1von 2

Adding existing code to SVN without using the import method.

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.).
1.
Create an empty folder in the repo (see below Creating Repo side folders)

svn mkdir https://svn.host/existing_path/myNewApp


2.
3.

Go to the parent directory of the project cd ~/local_dir


Check out the empty directory over your local folder. Don't be afraid - the files you have locally

will not be deleted. svn co https://svn.host/existing_path/myNewApp. If


your folder has different name locally than in repo, you must specify it as additional argument.
4.
You can see that svn st will now show all your files as ?, which means that they are not
currently under revision control
5.
Perform svn add on files you want to add to repo, 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.
6.
Commit with svn ci

Creating Repo side folders


In my my SVN repository, I'm trying to create tags/branches/trunk.
SVN1:/SVN/repo/android$ svnadmin create tempo
SVN1:/SVN/repo/android/tempo$ svn mkdir trunk
svn: '.' is not a working copy
I can't get rid of this error. I can create a folder by doing mkdir trunk, but is this the same?

Solution
The svn mkdir command can create a directory without a checkout, using the full URL form:
svn mkdir file:///SVN/repo/android/tempo/trunk -m "create trunk directory"
Note that you should not do things like directly create directories or files in your repository directory.
The contents of the repository are managed by Subversion itself and should be considered off limits.
Creating files or directories in there will not make those available through Subversion.
svn mkdir file:///home/user/svnRepo/KeenEdge2 -m create new project folder
svn mkdir file:///home/user/svnRepo/KeenEdge2/trunk -m create new project folder
svn mkdir file:///home/user/svnRepo/KeenEdge2/tags -m create new project folder

svn mkdir file:///home/user/svnRepo/KeenEdge2/branches -m create new project folder

Das könnte Ihnen auch gefallen