I was just wondering about something, I’m working on a project with several other programmers, we all use SVN for the project, I downloaded the svn tree to my local computer, and whenever I update something I commit it, up to now, everything is fine.
What if:
- I’m working on my local version, updating stuff in XXX.cpp (version1) while someone else uploads version2 of that XXX.cpp, and then I upload my version, will my “older” version overwrite the newer one?
Thanks,
SVN will do its best to merge the changes both developers have made. If you’re working in different parts of the file, it’ll most likely handle this without a problem. If both developers are changing the same lines of the file, or for whatever reason the merge is more complicated than SVN can handle, it’ll mark the file as conflicted and ask you to merge the conflicts manually (using a diff tool) when you try to update your local changes.
Basically, when you try to commit SVN will tell you that there are newer changes and you should update first. When you update it will conduct the merge on your local machine. Conflicted files will need to be fixed before you can commit. Once they’re fixed and all changes merged, you can commit.