Svn FAQs, errors, commands, and summary

Source: Internet
Author: User
Tags subversion client svn update

Svn FAQs, errors, commands, and summary
One of the mistakes I made myself was:/svn/MyERP_core_Main /! Svn/act/b8bd621b-c193-4969-b66c-d35f11009815 was later confirmed to be the address of the case, I modified the case, and then deleted the local file, check out the server file, and then submit and update it, the trouble is that you need to modify the file again and then submit it.

Svn change submission address: svnswitch -- relocatehttp: // 8080/svn/MyERP_Core_Main/MyERP_Core/trunk/keys: // 8080/svn/MyERP_Core_Main/MyERP_Core/trunk/keys

A svn file (BillUIDeviceFunction. m) conflicts. I copied the old file to replace the new file and used it again: svn resolved BillUIDeviceFunction. m Resolved conflictedstate of 'billuidevicefunction. M'

The svn resolves command indicates that the system conflict has been resolved. Ignore this command.

When svn adds foobar, xx is already under versioncontrol is displayed. My method is: add and submit first. Remember to add and then submit it again. For example: HummingBird/Config_Vehicle/Mobile/Vehicle, config_Vehicle is a new folder. In HummingBird svn add Config_Vehicle, then svncommit-m "" And then cd to Config_Vehicle svn add Mobile to add commit layer by layer. It seems like this is the case, if not, run the following code to delete the hidden ones. svn file. Try again.

Find.-name". Svn"| Xargs rm-Rf

Knowledge Point: 1013-7-19

Question 1:'.' Is not a working copy. Can't open file'. svn/entries ':The specified path cannot be found.

Answer: The reason is that the entered access path is incorrect. For example, svn: // "/" is not entered at the end, this error message is displayed.

Question 2:After the file is checkout, there is no SVN icon. Why?

A: Sometimes, after the client Checkout file, the SVN System icon is not displayed. You can execute "Cleanup" to display the SVN System icon.

Question 3:Why are the added files invisible to others and not in the version library?

Answer: The most likely reason is that you only executed "Add" instead of "Commit". In this way, you only indicated that a file is to be added locally, but it is not actually added to the version library. To add it to the version library, you must execute "Commit ". The same is true for deleting files.

Question 4:"Commit failed ....... You have toupdate your working copyfirst"Submission failed. You must first perform the update operation.

A: When multiple users modify the same file at the same time, other users have already submitted the file to the SVN server before submission, resulting in this error. Solution: update the file in the work copy.

Question 5:"One ormore files are not a conflicted state ."

A: If multiple users modify the same part of the same file at the same time, SVN cannot merge automatically, which will lead to this error. Solution: Compare the files in the work copy with the files on the server, manually merge.

Question 6:"Commit failed; File alreadyexists" failed to submit. The File ** already exists.

A: The version management system is very careful when changing the working copies on your computer. Before doing anything, it tries its best to write your intention to log files on your computer. However, if the operation is accidentally interrupted (for example, your computer crashes when a sudden power failure occurs), the log file record may be inconsistent with your final working status. One suggested solution: copy the file to be submitted to another directory, update the local file, and then store the copied file back for submission.

Question 7:Working copy '**' locked. Please execute the 'clean up' command.

A: Before the Subversion client submits the content, it copies and writes logs locally to prevent other clients from performing operations again. If an error occurs during the submission process, there will be uncleared logs, to solve this problem, you need to perform the "clean" operation, sort the work copies on your computer, and clear the error log records so that you can continue the operation.

Question 8:When cleanup is executed, the error "Subversion reported an error while doing a cleanup!" appears !" '**' Is not a working copy directory"

A: In this case, delete the temporary files under tmp in the hidden folder. svn, and then execute cleanup.

Question 9:Because there are many repositories and directories, TSVN is used to select the directory URL every time ofrepository has many addresses. How can this problem be cleared?What about it? What is the method used to clear the history in the browser?

A: Right-click TortoiseSVN-> Settings-> SavedData to clear what you want, including URL, log, window size, and password cache.

Question 10:When you select a directory named showlog in SVN, some versions only show the version number and (nodate), with no other information.Why?

A: There is a (no date) revision, which modifies the files in a directory that you do not have the permission to access for others.

Question 11:Attempted to lock analready-locked dir is not under versioncontrol

I deleted the log file in the. svn directory (I also deleted theoffending file in. svn/props-base)
Then did acleanup... Then resumed my update.

Question 12:Svn: warning: 'xxxxx' isalready under version control solution?

Only add the corresponding directory to SVN, but do not add files under the directory:
# Svn stuploads | grep ^? | Awk "{print/$2}" | xargs svn add-N
Cause: the directory version information hidden by. svn may have been modified.
Delete the. svn directory under the uploads directory and the files below (retain the. svn directory under the uploads directory)
# Finduploads | grep 'uploads/[^/.] */. svn '| xargs rm-rf

Or: find.-name" . Svn"| Xargs rm-Rf
Mac svn command is also applicable to linux

1. checkout the file to the local directory.
Svn checkoutpath (path is the directory on the server)
Example: svn checkout svn: //
Abbreviation: svn co

2. Add a new file or folder to the version library.
Svn add file
Example: svn add test. php (add test. php)
Svn add *. php (add all php files in the current directory)

3. Submit the modified file to the version library.
Svn commit-m "LogMessage" [-N] [-- no-unlock] PATH (if you choose to keep the lock, use the-no-unlock switch)
For example: svn commit-m "add test file for my test" test. php
Abbreviation: svn ci

4. Lock/unlock
Svn lock-m "LockMessage" [-- force] PATH
For example, svn lock-m "lock test file" test. php
Svn unlock PATH

5. Update to a specific version.
Svn update-r mpath
For example:
If there is no directory after svn update, all files in the current directory and sub-directories are updated to the latest version by default.
Svn update-r 200 test. php (restore the file test. php In the version library to version 200)
Svn updatetest. php (updated for version library synchronization. If the message "expired" is prompted during submission, it is because of a conflict. You need to update the file, modify the file, clear svnresolved, and then submit commit)
Abbreviation: svn up

6. view the file or directory status
1) svn status path (the State of the files and subdirectories under the directory. The normal state is not displayed)
【? : Not under svn control; M: The content is modified; C: A conflict occurs; A: It is scheduled to be added to the version Library; K: it is locked]
2) svn status-v path (displays the status of files and subdirectories)
The first column remains the same, the second column displays the working version number, and the third and fourth columns show the last modified version number and modifier.
Note: svn status, svn diff, and svnrevert commands can also be executed without a network, because svn retains the original copy of the local version in local. svn.
Abbreviation: svn st

7. delete an object
Svn delete path-m "deletetest fle"
For example, svn delete svn: // php-m "delete testfile"
Or directly delete svn test. php and then svn ci-m 'delete testfile'. We recommend that you use this
Abbreviation: svn (del, remove, rm)

8. View logs
Svn log path
For example, svn log test. php displays all the modification records of this file and changes to its version number.

9. View File details
Svn info path
Example: svn info test. php

10. Differences
Svn diff path (compare the modified file with the basic version)
Example: svn diff test. php
Svn diff-r m: n path (differences between version m and version n)
Example: svn diff-r 200:201 test. php
Abbreviation: svn di

11. Merge the differences between the two versions into the current file.
Svn merge-r m: n path
Example: svn merge-r 200: 205test. php)

12. SVN help
Svn help
Svn help ci

13. List of files and directories in the version Library
Svn list path
Displays all files and directories in the path directory that belong to the version library.
Abbreviation: svn ls

14. Create a new directory under Version Control
Svn mkdir: Create a new directory under version control.
Usage: 1. mkdir PATH...
2. mkdir URL...
Create a version control directory.
1. Each directory specified by the working copy PATH will be created on the local end and added to the new
Scheduling to wait for the next submission.
2. Each directory specified with a URL is created by submitting it to the repository immediately.
In both cases, all the intermediate directories must exist in advance.

15. Restore local modification
Svn revert: restore the original unchanged working copy file (recover most local modifications ). Revert:
Usage: revert PATH...
Note: The sub-commands do not access the network and will release the conflict. But it won't be restored.
Deleted directory

16. code library URL change
Svn switch (sw): update the working copy to different URLs.
Usage: 1. switch URL [PATH]
2. switch-relocate from to [PATH...]
1. update your work copy and map it to a new URL. The behavior is similar to "svn update" and
Merge files on the server with local files. This maps the work copy to a branch or tag in the same warehouse.
2. Rewrite the URL metadata of the working copy to reflect the changes on the simple URL. When the root URL of the Repository changes
(For example, the solution name or host name change), but the working copy is still mapped to the same directory in the same repository.
This command updates the correspondence between the working copy and the warehouse.

17. Conflict Resolution
Svn resolved: the "Conflict" Status of directories or files that remove working copies.
Usage: resolved PATH...
Note: subcommands do not follow the syntax to resolve conflicts or remove conflicting tags. They only remove conflicting tags.
Related files, and then allow the PATH to be submitted again.

18. output the content of the specified file or URL.
Svn cat target [@ version]… If a version is specified, search for it from the specified version.
Svn cat-r PREV filename> filename (PREV is the previous version, you can also write a specific version number, so that the output result can be submitted)

Aborting commit: 'xxxxxxxx' remains in conflict Error

The following error is prompted when submitting the project file to local SVN today:

Expiration: "global. php" in transaction "21-1",
You have to update your working copy first.

The following error occurs when you submit the update statement again:

Svn: Commit failed (details follow): svn: Aborting commit: 'Global. php' remains inconflict check the SVN manual to know that there is a conflict between multiple versions. In this case, you need to resolve the conflict (merge others' modifications ).

As an example, sallymodified sandwich.txt. Harry just changed the file in his local copy and submitted it to the server. Sally updated its copy of work before submission:

$ Svn update C sandwich.txt Updated to revision 2. $ ls -1sandwich.txt sandwich.txt mine. sandwich.txt. r1 sandwich.txt. r2

In this situation, subversiondoes not allow you to submit sandwich.txt until the three temporary files are deleted.

$ Svn commit -- message "Add a few more things" svn: Commit failed (details follow): svn: Aborting commit: '/home/sally/svn-work/sandwich.txt' remains in conflict

If you encounter a conflict, you can choose:

"Manually" the conflict text (check and modify the conflict flag in the file ).

Use a temporary file to overwrite your work file.

Run svn revert <filename> to discard all modifications.

Once the conflict is resolved, you need to run the svnresolved command to let Subversion know. In this way, three temporary files will be deleted, and the Subversion will not consider the file as in the conflict state.

$ Svn resolved sandwich.txt Resolved conflicted state of'sandwich.txt'

Manual merge conflicts
The first attempt to solve the conflict was frightening, but after some training, it was simply like riding a car downhill.

This is a simple example. You edited sandwich.txt at the same time with sally. Sallysubmitted the modification. When you updated your website and the conflict occurred, we had to modify sandwich.txt to solve the problem. First, take a look at this file:

$ Cat sandwich.txt Top piece ofbreadMayonnaiseLettuceTomatoProvolone <. mineSalamiMortadellaProsciutto ===== SauerkrautGrilledChicken >>>>>>>. r2Creole MustardBottom piece ofbread is less than or equal to the number and greater than the number. It is not a conflicting data. You must confirm that the content will be deleted before the next submission, the content in the middle of the first two groups of logos is your modifications in the conflict zone:

<. MineSalamiMortadellaProsciutto ===== the last two groups conflict with the changes submitted by Sally:

======= SauerkrautGrilledChicken >>>>>>>. r2. You generally don't want to delete the conflicting logo or modify Sally-it's amazing when she receives a sandwich. So you should go to her office or pick up the phone and tell Sally that you cannot get the expected kimchi from the Italian deli. Once you confirm the submitted content, modify the file and delete the conflict flag.

Top piece ofbreadMayonnaiseLettuceTomatoProvoloneSalamiMortadellaProsciuttoCreoleMustardBottom piece of bread:

$ Svn resolved sandwich.txt $ svn commit-m "Go ahead and use mysandwich, discarding Sally 'sedits. "Remember, if you are confused when modifying the conflict, you can refer to the three files generated by subversion-including the files you have not updated. You can also use a third-party merge tool to check the three files.

Copy and overwrite your work file
If you just want to cancel your modification, you can simply copy the Subversion to replace your work copy with the file generated by you:

$ SvnupdateC upgrade Updatedto revision 2. $ lssandwich. * sandwich.txt. mine. sandwich.txt. r2 sandwich.txt. r1 $ cp sandwich.txt. r2 success $ svn resolved success bet: Use success
If you get a conflict, after checking that you decide to cancel your modifications and re-edit them, you can restore your modifications:

$ Svn revert sandwich.txt Reverted 'sandwich.txt '$ lssandwich. * sandwich.txt note that when you restore a conflicting file, you do not need to run svn resolved again.

Now we are ready to submit the changes. Note that svnresolved does not need parameters like other commands we have learned in this chapter. When you think that the conflict is resolved, you only need to be careful to run svnresolved, -Once a temporary file is deleted, Subversion will allow you to submit the file, even if there is a conflict mark in the file.

Submit your changes
Last! Your modification is complete. You have merged all the modifications on the server. You are ready to submit the modifications to the version library.

The svncommit Command sends all the modifications to the version library. When you submit the modifications, you need to provide some log information that describes the modifications. Your information will be attached to this version, if the information is short, you can use the -- message (-m) option in the command line:

$ Svn commit -- message "Corrected number of cheese slices." Sendingsandwich.txt Transmitting file data. Committed revision 3.

However, if you write log information as part of your work, you may want to get the log information by telling Subversion a file name. Use the -- file option:

$ Svn commit -- file logmsg Sending sandwich.txt Transmitting filedata. Committed revision 4.

If you do not specify the -- message or -- file option, Subversion automatically starts your favorite editor to edit log information.

The version library does not know whether your modifications make sense as a whole. It only checks whether other people have modified the same file. If others have already done so, your entire submission will fail and you will be prompted that one or more files are out of date:

$ Svn commit -- message "Add another rule" Sending rules.txt svn: Commit failed (details follow): svn: Out of date: 'rules.txt 'intransaction' G'

At this moment, you need to run svn update to handle all the merge and conflict operations, and then try to submit.

We have covered the basic working cycle of Subversion. There are many other features that can be used to manage your version library and work copy. However, you can simply work with the commands described above.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.