- Delete your local changes (REVERT). your code will be overwritten by the newest file in the repository (written not by you). Do it if you are sure you want to delete your changes.
- Keep ur changes and commit. Do UPDATE and SVN client will be overwrite the file (with your code between “[[[[[[[[[[[ .mine” and “=======”, and the code in the repository between the second marker and “]]]]]]]]]]]]] .rN”). SVN client will also create a copy of your changed file (file.ext.mine), the original you worked with (file.ext.rM) and the newest file in the repository(file.ext.rN).now:
2.1 – Analyze differences and create a new file (recommended)
analyze the differences (DIFF) between files, then modify the file.txt, set the conflict resolved (RESOLVE, after that SVN client allows to commit) and COMMIT.
– 2.1.1 – For small files, you can edit directly file.txt (mind deleting the markers) and obtain a new file (operation called merging). Then set resolved and commit.
– 2.1.2 – For bigger files, it’s a good solution to use a tool for file comparison (DIFF), for example between file.ext.mine (your modified file) and file.ext.rN (the newest in the repository). Then save the new file as file.ext, set resolved (RESOLVE) and COMMIT.
2.2 – Overwrite the current file in the repository with your changes (be careful !). To do it, copy file.ext.mine to file.ext, set resolved(RESOLVE) and COMMIT
Netbeans SVN plugin
- “Revert modification…” and “Revert Local Changes”
- “Update” (the file will be coloured “red”, it’ necessary before 2.1.1 or 2.1.2), then:2.1.1 (imho the best solution). Manually merge the changes and create a new content for the “red” file (mind removing markers). “Resolve Conflicts” (now the colour will be blue, and the temporary files will be deleted), then “Commit“.
2.1.2 (Netbeans solution, not the best solution imho) .”Show changes”, double click on the bottom panel “Subversion” on the line with the “red” file (status=local conflict). In the main window, you will see the local file (left) and the remote (right). Netbeans will show line by line the conflicts (different code in the same line), and you can choose the line to have in the new file by clicking in “Accept” on the left or on the right. then “Commit”.
Netbeans/manual alternative to 2.1.2: Select file.ext.mine and file.ext.rN (where N is the highest), then tight click, “Tools” and “Diff”. Now create a copy with the rigth code, then copy all the content in file.ext, “Resolve Conflicts” and “Commit”. It Looks complicated but maybe it’s the best in case of lots of conflicts.
2.2. copy the content of the hidden file file.ext.mine to file.ext (the red one), then “Resolve Conflicts” and “Commit” (strongly not recommended !!).
- Do “Update” before start changing a file !! You will reduce the possibility of conflicts
- Do more “commit”, for example every 30min instead of 2h (choose it in according on the number of the clients working on the same file).
- In case of merging you will probably have to contact other developers to be sure about merging in case your code to commit is much different. Arrange on files with other developers (you’ll avoid to have lots of conflicts when committing)
- Other suggestions ?