0% found this document useful (0 votes)
48 views

Adding New Existing Code To S VN

This document describes how to add existing code to an SVN repository without using the import method. It outlines the steps to create an empty folder in the repo, check out that empty directory to the local code folder, add and commit files to place them under revision control in the repo. It also provides guidance on using svn mkdir to directly create folders in the repo without a checkout by specifying the full URL, as creating folders directly in the repo directory is not recommended.

Uploaded by

Al Gambardella
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Adding New Existing Code To S VN

This document describes how to add existing code to an SVN repository without using the import method. It outlines the steps to create an empty folder in the repo, check out that empty directory to the local code folder, add and commit files to place them under revision control in the repo. It also provides guidance on using svn mkdir to directly create folders in the repo without a checkout by specifying the full URL, as creating folders directly in the repo directory is not recommended.

Uploaded by

Al Gambardella
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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

You might also like