Aborting commit: 'xxxxxxxx' remains in conflict Error

Source: Internet
Author: User
Tags svn update

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 in conflict

After checking the svn manual, we can see that there were conflicts 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-1 sandwich.txt mine. sandwich.txt. R1 sandwich.txt. r2

In this case, subversionNoYou can 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.

  • RunSVN revert <FILENAME>To discard all modifications.

Once you have resolved the conflict, you need to use the commandSVN resolvedLet the Subversion know, so that three temporary files will be deleted, and the subversion will not think that the file is in a 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 of bread
Mayonnaise
Lettuce
Tomato
Provolone
<<<<<<< .mine
Salami
Mortadella
Prosciutto
=======
Sauerkraut
Grilled Chicken
>>>>>>> .r2
Creole Mustard
Bottom piece of bread

The minor signs, equal signs, and greater than signs are conflicting tags and are not 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:

<<<<<<< .mine
Salami
Mortadella
Prosciutto
=======

The last two groups conflict with the changes submitted by Sally:

=======
Sauerkraut
Grilled Chicken
>>>>>>> .r2

Generally, you don't want to just delete the conflicting logo and the changes made by Sally-she will be surprised when she receives the 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 of bread
Mayonnaise
Lettuce
Tomato
Provolone
Salami
Mortadella
Prosciutto
Creole Mustard
Bottom piece of bread

Run nowSVN resolved, You are ready to submit:

$ svn resolved sandwich.txt
$ svn commit -m "Go ahead and use my sandwich, discarding Sally's edits."

Remember, if you are confused when changing the conflict, you can refer to the three files generated by subversion-including files 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:

$ svn update
C sandwich.txt
Updated to revision 2.
$ ls sandwich.*
sandwich.txt sandwich.txt.mine sandwich.txt.r2 sandwich.txt.r1
$ cp sandwich.txt.r2 sandwich.txt
$ svn resolved sandwich.txt
Bet: Use SVN revert

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'
$ ls sandwich.*
sandwich.txt

Note: When you restore a conflicting file, you do not need to run it again.SVN resolved.

Now we are ready to submit the changes. Note thatSVN resolvedUnlike other commands we have learned in this chapter, parameters are required. When you think that a conflict is resolved, you only need to be careful when runningSVN resolved,-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.

SVN commitCommand to send all the modifications to the version library. When you submit the modifications, you need to provide some descriptions to modifyLog InformationYour information will be attached to this revision. If the information is short, you can use the -- message (-m) option in the command line:

$ SVN commit -- message "corrected number of cheese slices." sending sandwich.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 file data. 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.AlreadyBy doing so, your entire submission will fail and you will be prompted that one or more files are outdated:

$ SVN commit -- message "add another rule" sending rules.txt SVN: commit failed (details follow): SVN: out of date: 'rules.txt 'in transaction 'G'

Now you need to runSVN updateAnd 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: info-contact@alibabacloud.com 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.