Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN at command line - how to import, then commit

I'm exploring the automation of Subversion (SVN) commits.

I just imported the directory into Subversion using

svn import C:\sourcedir http://[my svn location] -m Message

This worked fine.

After modification I tried to commit the changes with:

svn add --depth=infinity --force *
svn commit -m Message

Unfortunately I get the error

svn: E155007: 'E:\sql' is not a working copy

This is correct; in Explorer using TortoiseSVN there are no icons either.

What am I missing? Why isn't my folder a working copy after importing it into Subversion?

like image 642
Lorenz Meyer Avatar asked Feb 15 '23 00:02

Lorenz Meyer


2 Answers

The SVN import command is a quick way to copy an unversioned tree of files into a repository, creating intermediate directories as necessary. SVN import doesn't require a working copy, and your files are immediately committed to the repository.

But in order to do svn add or svn commit, you should be inside the working directory. First you have to check out the files from SVN, then modify it as per the requirement, then svn add and svn commit from the working directory should work.

like image 184
Dipu H Avatar answered Feb 18 '23 21:02

Dipu H


Import does not imply converting the folder to be the working copy. That's how SVN rolls. If you want a working copy then do a checkout after import. If you want a working copy in the same folder then rename original folder, create new with the same name, and do a checkout there.

If you have huge amount of data, and don't want to spend time in needless transfers then don't import at all. Create empty working copy (either import an empty folder structure and do a checkout, OR create empty repository directly on SVN server and do a checkout), move your big files there, and then do a single commit.

like image 21
Dialecticus Avatar answered Feb 18 '23 22:02

Dialecticus