Question

Actually I have faced this issue many time during working with SVN. Most of the time I am working with VSS for source control but since last couple of months working with SVN.

We are using tortoise and AnkhSVN with VS 2010.

In our team there are 5-6 people and some of them are working on same file at a time. Now when somebody commit , we have seen that some other developer changes get vanished and Sometime we get some line with version number. This thing get consume lots of time and we have to resolve conflict and all.

Please provide information so we can avoid such issues.

Était-ce utile?

La solution

If two developers are working on the same file and make changes to the same are of code, then you have to manually resolve this conflict. There is no way to avoid it, no matter which version control you use.

The version control cannot know what the correct code is, so it requires a human intervention.

There is no way around this, other than preventing the users from working on the same code. this is done in svn by locking the file.

Autres conseils

Each developer must svn update before svn commit. Between the update and commit, the developer must do a full, clean build and run all tests to make sure their code still works after merging in all other developer's changes into their copy.

You can set svn:needs-lock on files or folders that need to be locked before making changes, they'll be forced to check for locks. When you will try to edit a file, you will be required to lock it first. And when it is already locked by someone else, they you get an error message, preventing you from making any changes. This can be done in Tortoise SVN in Properties -> Advanced

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top