Overview of Pushing or Pulling Changes to Source Code Control

   

Source control systems typically allow you to work on a project locally without affecting the work of other team members. However, some operations (such as add, delete, and rename) traditionally have required you to synchronize your local work immediately with other team members, or to remember to synchronize at the same time as you check in.

With the development environment and Visual SourceSafe together, you can:

You can delay changes locally until the all files are changed and/or working together. As you use source code control, the Microsoft development environment can remind you of incomplete actions or delay changes to your local solution.

Controlling When Your Changes Affect the Source Control Project

You can delay three basic source control actions (adding, renaming, and removing). These actions can be delayed for indeterminate amounts of time. Source control actions can go two ways — from the server to the local machine or to the server from the local machine.

You can delay these changes by clicking Remind on certain dialog boxes. Later you are prompted about the item, and you can send it on or delay it again. This can continue indefinitely, but the longer you delay a change to source control, the higher the probability for merge changes or other problems.

The initial dialog boxes that delay or remind you on these changes to source control appear according to certain actions, called pushing or pulling. Pushing an item refers to sending a copy of the changed item to the source control server from the local machine. Pulling an item refers to retrieving a copy of the changed item from the source control server to the local machine. The dialog boxes appear when an item is on one location for example, (your local machine) and not the other for example, (the source control server).

The dialog boxes that remind you of the delayed actions occur, by default, whenever a project item is pushed or pulled. Pushing actions include Check In and Add to Source Control. Pulling actions include Get Latest, Check Out, and Undo Check Out. You can change the timing of these reminder dialog boxes to appear all the time or not at all. For step-by-step instructions on how to set the timing of the reminders, see Changing the Timing of Reminder Dialog Boxes.

Strategies for Delaying Files to Source Control

You can delay adding a file, deleting a file, or renaming a file. This keeps your changes in the source control database from affecting your local files until you are ready. Depending on whether you are working with reference- or directory-based projects, you should employ a strategy that makes the most of the project model.

One strategy for directory-based projects is to check in the item initially, when it is created, so the name of the item is reserved in source control. You can then hold the item checked out locally while you work on it until you think that the item is ready to build. Before building, you can check in the item with the new version of the item ready to build available to the team.

For reference-based projects, the buildable state of the files in the source control database is not as critical, since the builds specify which files are to be used, instead of pulling all the files from a directory by default. The delaying tactics here become a good idea for testing and initial work in roughing out the content in the file.

CAUTION   Delaying changes to source code control for too long — especially if the source control database has other incomplete rename or delete actions with the same item — can lead to complicated situations and an unknown state of your file. Don't forget that source code control is intended to hold different versions of the item in a central location so you can restore a prior version if necessary.