Checking In Files

You must always check in files manually. Visual FoxPro doesn't automatically check in a file; for example, it doesn't check in a form when you close the Form Designer. Instead, it leaves the file checked out so you can continue to edit it, take it offsite, or work with it in some other fashion.

The exact result of the check-in process depends on the file you're checking in and on your source control software. For forms, menus, labels, class libraries, and other types of files, the file is treated as a binary file, and the source control software makes your new version of the file into the current one for other developers to check out.

Tip   Always remember to check in files when you're done editing them. If you keep them checked out for long periods, you might prevent other developers from working with them, and you'll prevent the latest version of the file from being backed up during the course of your network backup.

To check in a file

  1. In the Project Manager, select the file to work with.
  2. From the Project menu, choose Source Control, and then choose Check In.
  3. Enter a comment describing the changes you've made.
  4. In the Check In Files dialog box, select the file, and then click OK.

Checking In Text Files

When you check in a text file such as a .prg file, and if multiple versions of the file are checked out, the source control software doesn't simply overwrite the central version. Instead, it checks whether there have been changes to the file since you last checked it out. If so, it attempts to merge those changes with your file. To do so, it adds, deletes, and changes lines in your copy of the file.

When it's finished merging, the source control software might also give you the opportunity to check in your file. Don't check in your file right away. Instead, test your application using the new version of the file that incorporates both your changes and those of other developers. Only when you're satisfied that the application works correctly, check in your file. If other developers have made further changes to the same file, you might have to merge, test, and check in again.

In some instances, the source control software might report a merge conflict, which indicates that it cannot resolve changes between your changes and those of other developers. This can occur, for example, if you and another developer have been updating the same lines of the same program. If the source control software cannot merge successfully, it creates a version of the file that contains the original text plus your changes, marks the conflicts, and writes that file to your computer. (The exact means by which the conflicts are marked depends on the source control software you're using.) The file then appears in the Project Manager with a merge conflict icon:

To resolve the merge conflict, you must edit the file again, make your changes, and remove the merge conflict markers. When you're finished editing, Visual FoxPro prompts you to confirm that you've resolved all conflicts. The file is then marked with the merge icon:

Test your application to be sure that the changes are working properly. You can then attempt to check the file in again. If no more merge conflicts occur, your file becomes the current version.

See Also

Checking Out Files | Discarding Changes | Developing in Teams | Management of Files in a Source-Controlled Project