SVN collaboration failing
Today is the first day i'm playing with SVN. However 1 situation i cant solve:
I checkout on 2 pc's The first pc's Pc changes something in a file and commits. The second pc then tries to commit:
Commit failed (details follow):
File '/classes/ghjs.html' is out of date
I have to run update on the second pc, it gets the new file from pc 1, then i can commit properly again, however changes done before updating are lost.
SVN isn't that awesome if you have to commit / update before you can write a line of code else other people wor开发者_运维知识库king on te same file don't have you latest version.
I understand there isn't somethink for "live" collaboration, however there must be something that if you were working on a old version, instead of update you can manually "port" your changes to the latest version.
Im using "versions" as svn client and textwrangler as editor for editing php code.
I have to run update on the second pc, it gets the new file from pc 1, then i can commit properly again, however changes done before updating are lost.
No, they aren't lost. They are merged into your local copy (just as you expect them to be), and after updating you can commit to add them to the repository. If the merge results in conflicts you will be notified, but still no work will be lost.
If you lost your changes after an update you did something wrong -- I 'm not familiar at all with Versions so I can't say.
Local changes to files on pc 2 should not be lost on an svn update
. They will be merged with changes made on pc1 and committed. If changes are made to the same lines in conflict, you will be unable to commit until the conflict is resolved, choosing to keep the changes from either of the file versions. You should not lose local changes after updating though.
Then you 'update' on PC 2, it should merge the changes from PC 1 into PC 2's working copy. If the file was edited on PC 2 then it should either cleanly merge them, or give a merge conflict and you can manually resolve them.
It is done this way so that SVN has a place to merge the 2 changes. Merges are done in a working copy, not on the server.
If your changes from PC2 are lost when updating, and no merge errors are shown, then that indeed could be a problem.
精彩评论