You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by nikhil gupta <ng...@hotmail.com> on 2007/08/31 05:55:29 UTC

svn import vs svn commit

Hi There,

I've a question, just out of curiosity. 

What is the difference between an "svn import" and an "svn commit". 

I mean this in the context, where I have to add a large number of files to svn. I've 2 options. 

1. I import the whole structure to svn (using svn import).
2. I add the structure to svn using svn add & then commit using svn commit.

Is there any difference at all? If yes, which one of the two is better & why?

_________________________________________________________________
Download the latest version of Windows Live Messenger NOW!
http://get.live.com/en-ie/messenger/overview

Re: svn import vs svn commit

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 31, 2007, at 10:42, Hari Kodungallur wrote:

> Generally, the very first "commit" is done using an import --  
> because usually the first commit has a large number of files.

Although some people do prefer to do the very first "commit" using an  
"in-place import" instead, which is just checking out an empty  
directory, "svn add"ing files, and then doing "svn commit". Some find  
this gives them greater control and fewer surprises.

http://subversion.tigris.org/faq.html#in-place-import





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn import vs svn commit

Posted by Hari Kodungallur <hk...@gmail.com>.
On 8/31/07, Andy Levy <an...@gmail.com> wrote:
>
> On 8/31/07, nikhil gupta <ng...@hotmail.com> wrote:
> >
> > So, does that mean I can execute "import" only once in the whole
> lifetime of
> > my repository?
>
> No, you can import at any time, but IIRC only into an empty directory.
> An import lets you load into a directory without already having a
> working copy. You also get to do it in one step - svn import instead
> of svn add then svn ci.
>
> See
> http://svnbook.red-bean.com/en/1.4/svn.tour.importing.html#svn.tour.importing.import
>


Another difference is that to do 'svn add' followed by 'svn commit', you
need to have a working copy checked out. And more importantly, it will leave
the added files as part of the working copy.

When you do an 'svn import', you don't need to have a working copy. But if
you do it from a working copy, the added files are not part of the working
copy until you check it out again.

Generally, the very first "commit" is done using an import -- because
usually the first commit has a large number of files. And after the import,
user checkout directories of interest and add/update/delete and commit. But
when you have a large number of files to be added to the repository, import
is a good option. I think the svn_load_dirs script  (
http://svnbook.red-bean.com/en/1.1/ch07s05.html) that automates the vendor
drops uses import.

Regards,
-Hari Kodungallur

Re: svn import vs svn commit

Posted by Andy Levy <an...@gmail.com>.
On 8/31/07, nikhil gupta <ng...@hotmail.com> wrote:
>
> So, does that mean I can execute "import" only once in the whole lifetime of
> my repository?

No, you can import at any time, but IIRC only into an empty directory.
An import lets you load into a directory without already having a
working copy. You also get to do it in one step - svn import instead
of svn add then svn ci.

See http://svnbook.red-bean.com/en/1.4/svn.tour.importing.html#svn.tour.importing.import

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: svn import vs svn commit

Posted by nikhil gupta <ng...@hotmail.com>.
So, does that mean I can execute "import" only once in the whole lifetime of my repository?



> Date: Fri, 31 Aug 2007 08:12:57 +0100
> From: dave.pawson@gmail.com
> To: ng_g20@hotmail.com
> Subject: Re: svn import vs svn commit
> CC: users@subversion.tigris.org
> 
> On 31/08/2007, nikhil gupta <ng...@hotmail.com> wrote:
> 
> > What is the difference between an "svn import" and an "svn commit".
> >
> > I mean this in the context, where I have to add a large number of files to
> > svn. I've 2 options.
> >
> > 1. I import the whole structure to svn (using svn import).
> > 2. I add the structure to svn using svn add & then commit using svn commit.
> 
> 
> With a new, empty repo you have to import the data, then checkout.
> Thereafter you can add and commit.
> 
> Import is the 'first time only' operation.
> 
> HTH
> 
> 
> 
> -- 
> Dave Pawson
> XSLT XSL-FO FAQ.
> http://www.dpawson.co.uk

_________________________________________________________________
Download the latest version of Windows Live Messenger NOW!
http://get.live.com/en-ie/messenger/overview

Re: svn import vs svn commit

Posted by Dave Pawson <da...@gmail.com>.
On 31/08/2007, nikhil gupta <ng...@hotmail.com> wrote:

> What is the difference between an "svn import" and an "svn commit".
>
> I mean this in the context, where I have to add a large number of files to
> svn. I've 2 options.
>
> 1. I import the whole structure to svn (using svn import).
> 2. I add the structure to svn using svn add & then commit using svn commit.


With a new, empty repo you have to import the data, then checkout.
Thereafter you can add and commit.

Import is the 'first time only' operation.

HTH



-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org