YouTip LogoYouTip

Svn Conflict

* * * ### Version Conflict Reason: Assume that both users A and B update the kingtuns.txt file when the version number is 100. After user A completes the modification and submits kingtuns.txt to the server, the submission is successful, and the version number of kingtuns.txt becomes 101. At the same time, user B makes modifications on the kingtuns.txt file with version number 100. When the modification is completed and submitted to the server, the submission fails because it was not made on the latest version 101. We have checked out the tutorial01 repository locally. Next, we will implement the solution for version conflicts. We found an error in the HelloWorld.html file and need to modify the file and submit it to the repository. We will modify the content of HelloWorld.html to "HelloWorld! ". root@tutorial:~/svn/tutorial01/trunk# cat HelloWorld.html HelloWorld! Use the following command to view the changes: root@tutorial:~/svn/tutorial01/trunk# svn diff Index: HelloWorld.html =================================================================== --- HelloWorld.html (revision 5) +++ HelloWorld.html (working copy) @@ -1,2 +1 @@ -HelloWorld! +HelloWorld! Try to commit his changes using the following command: root@tutorial:~/svn/tutorial01/trunk# svn commit -m "change HelloWorld.html first" Sending HelloWorld.html Transmitting file data . svn: E160028: Commit failed (details follow): svn: E160028: File '/trunk/HelloWorld.html' is out of date At this point, I found that the commit failed. Because at this time, HelloWorld.html has already been modified and submitted to the repository by user02. Subversion will not allow user01 (the svn account used in this example) to submit changes, because user02 has already modified the repository, so our working copy is now obsolete. To avoid the code of both people overwriting each other, Subversion does not allow us to perform such operations. Therefore, we must update the working copy before submitting changes. So we use the update command, as follows: root@tutorial:~/svn/tutorial01/trunk# svn update Updating '.': C HelloWorld.html Updated to revision 6. Conflict discovered in file 'HelloWorld.html'. Select: (p) postpone, (df) show diff, (e) edit file, (m) merge, (mc) my side of conflict, (tc) their side of conflict, (s) show all options: mc Resolved conflicted state of 'HelloWorld.html' Summary of conflicts: Text conflicts: 0 remaining (and 1 already resolved) Here we enter "mc", prioritizing the local file. You can also use other options to perform different operations on the conflicted file. By default, it updates to the latest version. We can also specify which version to update to svn update -r6 At this point, the working copy is synchronized with the repository, and we can safely commit the changes root@tutorial:~/svn/tutorial01/trunk# svn commit -m "change HelloWorld.html second" Sending HelloWorld.html Transmitting file data . Committed revision 7.
← Svn BranchAngularjs2 Template Syntax β†’