Table of contents
1.SVN checkout
As an svn user, when we get an svn address, the first thing we do is svn checkout, which associates the svn with a local folder. This folder is preferably an empty folder, or make sure that there is no path with the same name as that on svn. Of course, this also shows that this operation is a connection operation. Generally, when we execute checkout, we only need to give the svn URL and the local path. In this way, the latest data on svn will be transferred to this folder, the directory structure will be automatically built, and the files on svn will automatically appear in the corresponding folder. Of course, you can choose an old version if you want, or only contain one level of directory or just the files in this folder. Perhaps you have discovered that each folder contains more than the content on the server. svn folder, this folder stores the properties of the folder, the properties, version and corresponding version of each file in this folder A copy of .
2.SVN update
This operation is to update the local data to a certain version on svn. The default operation is to update to the latest version. This operation is also a connection operation. If someone deletes a file during this process, it will delete the file on your machine, and if someone else changes a file, it will update the file. If you modify a file and someone else deletes it, the file will not be deleted, it will only have nothing to do with svn. If you modify a file, and this file has been modified by others, it will try to automatically merge your modifications during the update process. If it succeeds, its content will be the union of your modification and other people’s modification. If it fails, svn will mark the file as conflicted.
3.SVN resolve
Using svn means that you are already on the road of editing and merging, so what does svn do when there is a conflict, and how to solve the conflict?
In the process of marking conflicts, if it is a text file, such as cpp and h files, svn will modify it so that it cannot be compiled, and generate a theirs and mime, including the original version on the svn server and my own.
If it is a binary file, svn will not modify it, but will generate two r?? and r?? in the directory. One is the base version of svn before your update, which is the version you executed last update. One is the current updated version on svn.
You can choose to use theirs directly or use mime or fall back to the last update version, or put the two files together and merge them manually as a solution.
This operation is an offline operation.
4.SVN commit
The commit operation of svn is to send the modification from the working copy to the repository and mark the version as a new version. If someone has already operated on this version during this process, that is, your local base version is different from the server, it will be forced You perform an update operation, which is a wire operation. The process of commit is just to submit some of your local modifications to svn so that the one on svn is consistent with yours. Before submitting, you must have resolved the existing conflicts that need to be submitted.
5.SVN add
If a file is not managed by svn, you need to add it to svn, this operation is an offline operation, just mark this file as needing to be added, the actual operation of adding to svn storage will be performed at the next commit. In this process, you need to be careful not to add some unnecessary files, such as compiled temporary files, to svn.
6.SVN import
Of course, you can add some files directly to svn without modifying the svn management status of these files, you can choose to import them into svn. Note that if a file is imported, the given url is the final file name it adds to svn. If a folder is imported, all sub-files and folders will be placed in the corresponding directory of the corresponding url according to the directory tree. In the tree, the root folder will not be added. This operation is a wire operation.
7.SVN cleanup
This operation cleans up the entire selected folder and its subfolders, but it's not cleaning up junk files or anything, which is certainly not svn's job. It will not automatically resolve the conflict, if it can be automatically resolved, why not do it when updating. If you forcibly interrupt a certain svn operation, such as the svn operating program stops responding or terminates unexpectedly, the folder may be locked and needs to be cleaned up. If the time stamps of many files in your folder have changed, it is also best to perform the following cleanup to speed up the execution of svn operations. This operation is an offline operation.
8.SVN delete
Since there is a way to add a file, there must be a way to delete it. Although the effect you see is that the file is deleted directly, it is actually the same as adding. This operation is an offline operation, and the result of the operation will be marked. The next time the server commits The files on it will be deleted.
9.SVN revert
If there is a problem with your modification, or you add or delete the wrong file, etc. If you want to restore the operation, you can perform the revert operation before committing and return to a certain step, so that these modifications will be restored to the basic version state. This operation will not have anything to do with the svn server, it will not connect to the server or update the file, it will simply restore to the base version.
This operation is an offline operation.
10.SVN diff
This operation is to compare the difference between your working version and a certain svn version. Of course, the default is your basic version, because your working version is modified from the basic version.
It is an offline operation when comparing with the base version, and an online operation when comparing with the historical version.
11.SVN export
This operation can export all working versions in a folder already under svn management to a folder, or export a version directly from the svn server to a folder. The exported folder is no longer under svn's administrative control, will not have a .svn directory, and will certainly not contain files not under svn's administrative control.
It is an offline operation when exporting the working version, and it is an online operation when directly exporting from svn.
12.SVN copy
The name of the operation is obvious, it is the copy operation, what is the advantage of copying files on svn, why not just copy the files and add them to svn. I have also considered this issue, svn copy can preserve the history of files before copying, which should be the biggest benefit.
This operation is an offline operation and needs to be submitted to take effect.
13.SVN move
Like copy, the preservation of history is also the biggest difference from the method of deleting the source file after copying, and it is also an offline operation that needs to be submitted to take effect.
14.SVN lock
If you want to modify this file exclusively, you can lock the file, so that you can lock the file, so that others must wait for you to submit the modification or release the lock before submitting their modification. This operation will not have any impact on other people's svn local storage, but just cannot submit data. If a file has a flag like svn:needs-lock, the file will be set to read-only, prompting you to obtain a lock to modify it.
15.SVN unlock
Although it is unlock, in fact, we usually don't use it to pair with lock, because svn automatically releases the lock by default during the commit operation. The usefulness of this operation is to perform it when you do not want to lock the file after you get the lock.
If there is any mistake, I hope all the big guys who are watching can point it out~