Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does svn checkout overwrite existing local files?

Suppose I have a svn directory and a local directory. If I svn co into the local directory, and there happens to be files with the identical name, is there any risk that I will overwrite the local files?

like image 930
user2763361 Avatar asked Mar 26 '14 13:03

user2763361


People also ask

Does svn update overwrite local changes?

Subversion is pretty smart about updating and never just overwrites files that have local changes with copies from the repository. The most important thing to take away from this section is: If you collaborate with others on one repository, remember to update your working copy regularly.

What does checkout in svn do?

svn checkout checks out (retrieves) a working copy of the repository into the specified folder. If you don't have access to the repository, and there's not already a current copy of the source in the folder, you can't possibly do a build. If there is a current copy of the source there, it should include build.

How do I checkout a file in svn?

So we right-click on this folder and select 'SVN Checkout…' From here we'll specify the location of the repository that we want to check our files out from. So something like… If you've forgotten what this URL is then you can go back to the VisualSVN server app and right click to select 'Copy URL to Clipboard'.

Can I delete svn checkout folder?

Use TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit.


1 Answers

If you look at the documentation for svn checkout, it says:

Prior to version 1.7, Subversion would complain by default if you try to check out a directory atop an existing directory which contains files or subdirectories that the checkout itself would have created. Subversion 1.7 handles this situation differently, allowing the checkout to proceed but marking any obstructing objects as tree conflicts. Use the --force option to override this safeguard. When you check out with the --force option, any unversioned file in the checkout target tree which ordinarily would obstruct the checkout will still become versioned, but Subversion will preserve its contents as-is. If those contents differ from the repository file at that path (which was downloaded as part of the checkout), the file will appear to have local modifications—the changes required to transform the versioned file you checked out into the unversioned file you had before checking out—when the checkout completes.

In short:

  • without --force you get a conflict you must resolve
  • with --force you have modifications to commit if the files are different
like image 115
crashmstr Avatar answered Oct 06 '22 00:10

crashmstr