Conﬂicts occur when Subversion is unable to merge two ﬁles together automatically. Generally, this happens when two users have independently made a change to the same area of a ﬁle. Because Subversion doesn’t actually understand the ﬁles that it merges, it has no way of ﬁguring out which of the two versions to use. Its only recourse, in this case, is to let the user solve the conﬂict.
Before you can resolve a conﬂict, you have to have a conﬂict. So, let’s create a conﬂict. To start, check out a new working copy, which will represent the work of a second developer.
$ svn checkout file:///home/bill/my_repository/trunk/ /home/bill/ ¬
Checked out revision 7.
Then, edit the ﬁle hello.c in your new working copy, and change the line
so that it reads
printf("Subversion is Great!!\n");
After the change has been made, commit it to the repository
$ svn commit --message "Changed to a more conservative phrase" /home/ ¬
Transmitting file data .
Committed revision 8.
With your changes from the new working copy committed, it’s time to go back to your original working copy. Once there, edit the copy of the ﬁle hello.c that is stored there, without updating the ﬁle from the repository ﬁrst. This time, change the line
to the third, yet equally complimentary line,
printf("Subversion is Awesome!!\n");
Now, try to commit this change to hello.c.
$ svn commit --message "Decided on a more hip phrase" /home/bill/ ¬
svn: Commit failed (details follow):
svn: Out of date: '/my_repos_trunk/hello.c' in transaction '9'