Subversion - What are the differences between the SVN checkout and SVN update commands?

喜欢而已 提交于 2019-11-30 01:45:56

As I see it, the big difference is that checkout creates a working copy, whereas update brings down changes to an existing working copy.

svn checkout copies all the versioned files from the given directory in the repository at the given revision (default HEAD), and copies them to your local machine. It also generates all of the hidden .svn directories, and the meta-data within them, that make these files a working copy.

svn export copies all the versioned files from the given directory in the repository at the given revision (default HEAD), and copies them to your local machine, but produces a standard directory hierachy. (It does not produce a working copy that can be updated or checked back in).

svn update applies changes to an existing working copy. If, in doing so, a conflict is discovered the user is alerted and must resolve this before being able to commit any changes. When using svn commit it is a requirement that the working copy to be committed is up to date (ie. the same revision as HEAD).

Update will update your checked out version to the latest version (or a specified other revision) in repository. If you have made changes to your working copy, they will still be there after the update. If files have been added or deleted to the repository, that will be reflected in your working copy. If there are changes both in your local copy and in the repository SVN will try to merge all changes for you, if that doesn't work it'll flag for a conflict that you resolve manually.

Subversion uses hidden directories of metadata to enable the functionality it provides. These .svn directories are what makes a directory into a Subversion working copy -- without these, it's just a directory and Subversion can't do much with it.

UPDATE is an operation that is performed over a Subversion working copy; no .svn directories, no UPDATE. CHECKOUT is the operation that creates a working copy.

George

svn update brings only the difference in files from the user version to the latest available version. If no difference no actions.

But checkout creates a new folder and brings all the files for that branch. Checkout is a good way to work if we constantly change branches we work on. Update is when we have a trunk and need to get the updates done by others on that trunk.

During using the SVN, the significant difference between checkout and update is that: You can only use the checkout command once to build up the relation between a local directory and the repository (under version control) and to copy all the files from the root repository to a local working directory. After that, using checkout to update the copies in local directory will generate errors as follows:

svn: E175002: Unable to connect to a repository at URL 'https://********'.

svn: E175002: The OPTIONS request returned invalid XML in the response:****."

The only way to update current versions in the local directory is to use the svn update command.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!