- TFS is a server used to store files and stores files of different versions. Therefore, the number and content of files vary by version.
In Fig-00, the number of files on the server is inconsistent with that on the local folder common.
Fig-00
In Fig-01, in the local solution, we use "show all files ". Compared with files on TFS, the three missing files exist, but are not included in the current project. This also verifies that TFs only stores the file itself and does not reflect the validity of the project file.
Fig-01
- How can I edit a file correctly?
Let's look at an incorrect scenario.
Problem scenarios: We started to maintain a new project named homeland through KT. We need to upgrade the source code of the project from version 1.0 to 2.0. After obtaining the latest source code, the Configuration Manager A directly copies and pastes the source code V2.0 to the local ing path. After the result is copied, we find that the object identity is still a blue lock. In this case, Mr. A needs to upload the updated source code V2.0 to the server. he selects the local solution file and right-click it and selects "get the latest file", as shown in Fig-02, select the second item "overwrite all files when the local file version is the same as that on TFs ".
Obviously, the server is V1.0 and the local version has been updated to V2.0. As shown in Fig-03, the system detects that the log. CS file has been updated locally.
Fig-02
Fig-03
We need to deal with this conflict, as shown in Fig-04, we select the first item "check out and automatically merge", which means that the local file is the main, keep the difference, the system automatically checks out the corresponding log. CS file, and then check in.
At this time, you will ask "Why don't you check in". If you do this, you will find that there is no check-in action in this case, because you have not previously executed "check out ", how can I check in?
Fig-04
Correct check-in and check-out:
- When editing files, we try to operate a single file as much as possible, rather than the batch operations described above.
- When updating a file, remember to check out the file first, then update the file (including the scenario where the file is overwritten in the previous section), and then check in.
- If you must obtain files in batches from the server, we recommend that you check "overwrite all files even if the local version matches the specified version .".