user3799279
user3799279

Reputation: 153

Team Foundation Server (TFS) - How does a file difference relate to a conflict?

I've made a change to a line in a file and the file has been automatically checked out. I do a "Compare" (VS2012) and that line is highlighted showing the difference between my local version and the server version. That all is as I expect. What I'm trying to understand is, if I do a "Get All Conflicts" there are none. I expected to see the line where my local version differs from the server version, but I don't. I expected the difference to be a conflict, but apparently it's not? So how are differences and conflicts related?

Upvotes: 0

Views: 61

Answers (1)

afrazier
afrazier

Reputation: 4902

A conflict occurs when the version of the file you currently have checked out to edit is not the newest version on the server.

For example:

Changeset 100 Adds a file foo.c.

Changeset 101 Modifies foo.c.

You do a "Get Latest" at this point and get the version of foo.c as it existed in Changeset 101. As you modify the file, there's currently no conflict, since you're modifying the latest version of the file.

Your teammate checks in Changeset 102 that Modifies foo.c. At this point, your modifications to the file constitute a Conflict because all your changes are based on the version of foo.c as it existed in Changeset 101.

If you were to attempt to Check In or Get Latest, TFS would detect the conflict. What happens next depends on a few factors:

  • The value of the "Attempt to automatically resolve conflicts when they are generated" checkbox from Source Control -> Visual Studio Team Foundation Server Setting.
  • Whether or not TFS is able to merge your changes into the latest version of the file.

If the box is checked and TFS can auto resolve the changes, you won't see much of anything. If either of these things it not true, then TFS will display the Resolve Conflicts box.

Upvotes: 2

Related Questions