resolve SVN Command

How to use resolve SVN (Subversion) Command in Linux / Windows?

Explanation


resolve command is used to resolve the conflicts on working copy of the files. Conflict arises when two or more users attempt to make changes in the same file.

Usage:

svn resolve --accept <path>
--accept : specify automatic conflict resolution source
('mine-full', 'theirs-full')

Example:

  • Look at the example of svn resolve,
    Consider that,you have edited the file 'test.php', which was already edited and commited by another user in another revision.
    Now if you update the changes into repo, you will receive an error message,
    svn update
    Output:-----------------------------------------------
    Conflict discovered in 'test.php'.
    Select: (p) postpone, (df) diff-full, (e) edit,
    (mc) mine-conflict, (tc) theirs-conflict,
    (s) show all options: p
    C test.php
    Updated to revision 5.
    Summary of conflicts:
    Text conflicts: 1

    ------------------------------------------------------------
    It shows that file 'test.php' has conflict.
    where,
    (e) edit - the file will open to edit
    (df) diff-full - shows the diff between the versions.
    Now the svn will create three files 'test.php.mine' ,'test.php.r5', 'test.php.r6'.
  • Now you can determine the conflicts of the file using the following command,
    more 'test.php'
    Output:-----------------------------------------------
    afdfsdfsdfsdfsd
    svn
    <<<<<<< .mine
    resolve
    =======
    Svn Test
    >>>>>>> .r5

    --------------------------------------------------------

  • Now you can resolve conflicts of the file using the following command,
    svn resolve --accept mine-full test.php
    It will update your changes to the repository.It doesn't merge with changes done by another user.
    or
    svn resolve --accept theirs-full test.php
    It will update your changes to the repository and merge with the changes done by another user.

Result:


From the above cmd, all the conflicts in the file 'test.php' are replaced.

Ask Questions

Ask Question