Difference between checkout and export in SVN

前端 未结 9 1581
执笔经年
执笔经年 2021-01-30 08:17

What is the exact difference between SVN checkout and SVN export?

From what I know, export does not include the .svn directory which include metadata, and checkout inclu

相关标签:
9条回答
  • 2021-01-30 08:30

    (To complement Gerald's answer...) One further subtle difference is that, although the command:

    svn checkout ...repos_location/my_dir .

    puts the files in my_dir into the current directory (with the .svn folder)

    in certain versions of the svn, the command:

    svn export ...repos_location/my_dir .

    will create a folder called my_dir in the current directory and then place the exported files inside it.

    0 讨论(0)
  • 2021-01-30 08:39

    Very simple difference, If you just want to see the structure of your project then go for export.

    And if you want to work on your files then you need to checkout as it will include the .svn folder which contains the metadata which makes the working copy, else you get the error in export.

    If you do svn export and then edit some files and then commit, then you will get an error:

    ../../xxx is not your working copy.

    0 讨论(0)
  • 2021-01-30 08:40

    Any chance the build process is looking into the subdirectories and including something it shouldn't? BTW, you can do a legal checkout, then remove the .svn and all it contains. That should give you the same as an export. Try compiling that, before and after removing the metadata, as it were.

    0 讨论(0)
  • 2021-01-30 08:45

    svn export simply extracts all the files from a revision and does not allow revision control on it. It also does not litter each directory with .svn directories.

    svn checkout allows you to use version control in the directory made, e.g. your standard commands such as svn update and svn commit.

    0 讨论(0)
  • 2021-01-30 08:46

    As you stated, a checkout includes the .svn directories. Thus it is a working copy and will have the proper information to make commits back (if you have permission). If you do an export you are just taking a copy of the current state of the repository and will not have any way to commit back any changes.

    0 讨论(0)
  • 2021-01-30 08:46

    Are you re-running your checkout or export into an existing directory?

    Because if you are, checkout will update the working copy, including deleting any files.

    But export will simply transfer all the files from the reporsitory to the destination - if the destination is the same directory, this means any files deleted in the repository will NOT be deleted.

    So you export copy may only work because it is relying on a file which has been deleted in the repository?

    0 讨论(0)
提交回复
热议问题