I took a couple of SVN tutorials on how using branches/merge to work in team but something is still not working in the flow. I am using Tortoise SVN + Visual SVN Server in LAN. There are N developers.
Scenario 1: branch is inside main trunk
- Developer-A checks out the "OurProject" production release, let's say from http://svn-server/OurProject. In the beginining there are no branches.
- Developer-A creates "Branch-A" under the main path, so http://svn-server/OurProject/Branch-A. He switches the working folder to the branch and starts coding. He adds some files and edit some others. He commits the changes to the branch.
- Developer-B knows nothing about his colleague's work and his branch, so he simply checks out the entire "OurProject" from http://svn-server/OurProject. This leads to Developer-B checking out the whole "OurProject" structure, with the "Branch-A" folder either! This is the first strange thing to me.
- Developer-B starts a new "Branch-B" branch at the path http://svn-server/OurProject/Branch-B and starts coding.
- Developer-B finishes coding, while developer A is still working. He merges his Branch-B into the project root and commits. This leads to "Branch-A" being deleted from the trunk by developer B! No, I don't think this is the right solution.
Scenario 2: branch is outside main trunk (merge from branch to trunk)
- Developer-A checks out the "OurProject" production release, let's say from http://svn-server/OurProject/trunk. In the beginining there are no branches.
- Developer-A creates "Branch-A" under the "branches" subfolder, so http://svn-server/OurProject/branches/Branch-A. He switches the working folder to the branch and starts coding. He adds some files and edit some others. He commits the changes to the branch.
- Developer-B knows nothing about his colleague's work and his branch, so he simply checks out the entire "OurProject" from http://svn-server/OurProject/trunk. This leads to Developer-B checking out only the production code, without visibility of the collagues' branches. Fine.
- Developer-B starts a new "Branch-B" branch at the path http://svn-server/OurProject/branches/Branch-B and starts coding.
- Developer-B finishes coding, while developer A is still working. He merges his Branch-B into the project root (from branch to trunk) and commits. This leads to trunk overwriting all "Branch-B" modifications! Not right.
Scenario 3: branch is outside main trunk (merge from trunk to branch)
... (same as previous scenario, except last point)
- Developer-B finishes coding, while developer A is still working. He merges his Branch-B into the project root (from trunk to branch) and commits. This leads to Tortoise SVN warning for conflicts. I choose "Mark as resolved, accept current working copy state".
- Developer-B switches to trunk and SVN deletes my new branch files and again all my branches modifications are lost.
After dozens of tries I wonder which can be a real flow. Thank you for any help