[linux] Difference between checkout and export in SVN

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 included that .svn directory. Yet, my colleague had this problem recently that there is a different behaviour for the stuff compiled from sources that is checkout and exported from SVN repo. Both of them compiled correctly, but the one compiled from svn export works, but the one that is checked out doesn't work at all.

PS: The stuff being compiled is the Linux 2.4 kernel that is being used in an embedded device. The image compiles and load correctly, but the checked out one doesn't work. It causes a kernel panic during insmod. Why could this happen at all?

PPS: We've tried checksumming and diff tool to check the difference between the two directories that are exported and checked out from SVN. Both of them are the same except for the .svn directory.

This question is related to linux svn export svn-checkout

The answer is


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?


(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.


Use export if you want to upload (or give to somebody) a project. If you are working with a project, use checkout.


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.


Additional musings. You said insmod crashes. Insmod loads modules. The modules are built in another compile operation from building the kernel. Kernel and modules have to be built from the same headers and so forth. Are all the modules built during the kernel build, or are they "existing"?

The other idea, and something I know little about, is svn externals, which (if used) can affect what is checked out to your project. Look and see if this is any different when exporting.


(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.


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.


Additional musings. You said insmod crashes. Insmod loads modules. The modules are built in another compile operation from building the kernel. Kernel and modules have to be built from the same headers and so forth. Are all the modules built during the kernel build, or are they "existing"?

The other idea, and something I know little about, is svn externals, which (if used) can affect what is checked out to your project. Look and see if this is any different when exporting.


if you are using tortoise svn client - while exporting - it displays ..export / checkout , it is confusing , it is just export only. only view/read use export , to commit use - "checkout"


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.


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.


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?


Additional musings. You said insmod crashes. Insmod loads modules. The modules are built in another compile operation from building the kernel. Kernel and modules have to be built from the same headers and so forth. Are all the modules built during the kernel build, or are they "existing"?

The other idea, and something I know little about, is svn externals, which (if used) can affect what is checked out to your project. Look and see if this is any different when exporting.


if you are using tortoise svn client - while exporting - it displays ..export / checkout , it is confusing , it is just export only. only view/read use export , to commit use - "checkout"


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.


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.


Use export if you want to upload (or give to somebody) a project. If you are working with a project, use checkout.


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.


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.


Use export if you want to upload (or give to somebody) a project. If you are working with a project, use checkout.


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.


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.


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.


Additional musings. You said insmod crashes. Insmod loads modules. The modules are built in another compile operation from building the kernel. Kernel and modules have to be built from the same headers and so forth. Are all the modules built during the kernel build, or are they "existing"?

The other idea, and something I know little about, is svn externals, which (if used) can affect what is checked out to your project. Look and see if this is any different when exporting.


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.


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.


Examples related to linux

grep's at sign caught as whitespace How to prevent Google Colab from disconnecting? "E: Unable to locate package python-pip" on Ubuntu 18.04 How to upgrade Python version to 3.7? Install Qt on Ubuntu Get first line of a shell command's output Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? Run bash command on jenkins pipeline How to uninstall an older PHP version from centOS7 How to update-alternatives to Python 3 without breaking apt?

Examples related to svn

Error "can't use subversion command line client : svn" when opening android project checked out from svn How to view changes made to files on a certain revision in Subversion Intellij idea subversion checkout error: `Cannot run program "svn"` How change default SVN username and password to commit changes? How to rename a file using svn? Connect Android Studio with SVN svn: E155004: ..(path of resource).. is already locked SVN Commit failed, access forbidden How to add an existing folder with files to SVN? Update OpenSSL on OS X with Homebrew

Examples related to export

Export multiple classes in ES6 modules Why Is `Export Default Const` invalid? How to properly export an ES6 class in Node 4? ES6 export all values from object Export a list into a CSV or TXT file in R How to export database schema in Oracle to a dump file Excel VBA to Export Selected Sheets to PDF How to export all data from table to an insertable sql format? Export pictures from excel file into jpg using VBA -bash: export: `=': not a valid identifier

Examples related to svn-checkout

SVN checkout the contents of a folder, not the folder itself How to git-svn clone the last n revisions from a Subversion repository? Difference between checkout and export in SVN