Compartir a través de


Check files in and out

In Blend para Visual Studio 2012, you can check files out explicitly or implicitly. By checking files out, you make sure of the following:

  • Other team members can see that you are working on those files, either by viewing file status in Microsoft Visual Studio Team System Team Explorer or by checking out the file in Blend and reading the Output pane of the Results panel. They can decide whether they want to wait to work on the same files until you are done.

  • Other team members know that they can get your latest changes after you check the files back in.

SugerenciaSugerencia

A file can be checked out by more than one person at the same time. If a file is changed by someone else after you check it out, when you check it back in, the file will go through a merging process to resolve any conflicts. Alternatively, you can use Microsoft Visual Studio Team System 2010 Team Explorer to check out files exclusively (so that no other team member can check them out at the same time). For more information, see How to: Check Out and Edit Version-Controlled Items on MSDN.

Nota importanteImportante

Checking out a file does not automatically get the latest version. As a best practice, get the latest version of your files before working on them. Otherwise, when you check the file back in, you might have to resolve conflicts between your changes (made to an older version of the file) and those made by other team members. Merging file changes is easily handled by Blend, but as a best practice, always get the latest version of files before working on them, and then immediately check out the files that you are going to work on.

For more information, see Get the latest copies of project files and Merge and resolve conflicts when checking files in.

To check files out explicitly

  1. As a best practice, get the latest version of your files from the Team Foundation server before you check files out.

    For more information, see Get the latest copies of project files.

  2. In the Projects panel, right-click the solution, a project, or a file.

  3. From the drop-down list that appears, click one of the following options:

    • Check Out This Item   Checks out only the selected item.

    • Check Out   Recursively checks out the selected item and all child items. For example, if you selected a .xaml file that has a corresponding code-behind file (.vb or .cs), both files will be checked out. If you selected the solution, every file in the solution will be checked out.

      [!NOTA]

      As a best practice, check out the corresponding code-behind files of .xaml files. You can do many things in Blend that automatically make changes to code-behind files. For example, adding an event handler will add a method declaration to a code-behind file.

    If another team member has checked out the item exclusively, Blend will display a message to let you know that you cannot check the file out. Otherwise, Blend checks the files out to you. The Output pane of the Results panel logs your actions and reports if someone else also has the file checked out (not exclusively). The Projects panel displays a check mark JJ170603.62863683-36e0-4c3e-818f-ffe18a7fec91(es-es,VS.110).png next to each file that you checked out.

To check files out implicitly

  1. As a best practice, get the latest version of your files from the Team Foundation server before you check files out.

    For more information, see Get the latest copies of project files.

  2. Open a file to make changes.

  3. Save the file (Ctrl+S).

    Saving the file checks it out automatically (if no other team member has checked it out exclusively). The Output pane of the Results panel logs your actions and reports whether someone else also has the file checked out. The Projects panel displays a check mark JJ170603.62863683-36e0-4c3e-818f-ffe18a7fec91(es-es,VS.110).png next to each file that you checked out.

To check files in

  1. In the Projects panel, right-click the solution, a project, or a file, and then click Check In.

    The Check In dialog box appears.

    JJ170603.B4_SourceControl_CheckInDialogBox(es-es,VS.110).png

  2. Make sure Source Files is selected on the left side.

    [!NOTA]

    There are other options and tasks that you can perform in the Check In dialog box. For example, you can click the Check-in Notes button to add notes that will be stored with the checked-in files, or you can click the Work Items button to associate work items with the checked-in files. For more information, see How to: Check In Pending Changes on MSDN.

  3. Make sure that every file that you want to check in has a check mark next to it.

  4. Under Comment, enter a description of your changes. This will help other team members understand the changes that you made, and will help you identify this version of the files later if you want to revert to an earlier version of the files.

  5. Click Check In.

    Blend saves your files to the Team Foundation server and checks them back in. The Output pane of the Results panel logs your actions, and the Projects panel displays locks JJ170603.de1ca98f-81f1-4666-930e-e509e31ea168(es-es,VS.110).png next to those files.

    [!NOTA]

    If another team member made changes to the file while you had it checked out, you might have to resolve conflicts before checking the file back in. For more information, see Merge and resolve conflicts when checking files in.

To work on files when the Team Foundation server is unavailable

If your Team Foundation server is offline, or if you must work at home where you do not have access to the Team Foundation server, you can still use Blend to make changes to files that are under source control.

  1. Using Microsoft Visual Studio Team System Team Explorer, open the solution file, and then, in the Go Offline dialog box that appears, click OK. For more information, see How to: Work Offline when the Server is Unavailable on MSDN.

  2. Open the solution in Blend and make your changes. When you save files, Blend displays a Save of Read-Only File dialog box. Click Overwrite to remove the write-protection from the file.

  3. When the Team Foundation server is available again, use the procedure at How to: Work Offline when the Server is Unavailable to go back online. If another team member made changes to the file while you had it checked out, you might need to resolve conflicts.

    For more information, see Merge and resolve conflicts when checking files in.

Vea también

Tareas

Add files and folders to a project under source control

Undo or view the list of pending changes

View or compare the changes made to files