Develop Code and Manage Pending Changes
Most changes that you make to your files are queued as pending changes. As you work, you can organize, manage, and get details about what you’ve changed.
Required Permissions
You must be one of the Contributors for your team project. See Team Foundation Server Default Groups, Permissions, and Roles.
What do you want to do?
Work in Solution Explorer
Use the My Work page to manage your work
Use the Pending Changes page to manage your work
See what you changed
Undo your pending changes
Use the command prompt
Get tips
Work in Solution Explorer
Solution Explorer is probably the hub of the development work you do.
Note
We recommend you use the following approach instead of the Open from Source Control dialog box.
To open a solution under version control
On the menu bar, choose View, Team Explorer.
In Team Explorer, choose Home, and then choose Source Control Explorer.
In Source Control Explorer, navigate to the folder that contains your solution, and then then double-click it. (Keyboard shortcut: open the shortcut menu and choose View.)
To display Solution Explorer
- On the menu bar, choose View, Solution Explorer (Keyboard shortcut: Ctrl + Alt + L).
When you open and modify a file from Solution Explorer, the file is automatically checked out for you. Icons appear to indicate which files you have not changed , those you have checked out , and those you have added to the solution .
Use the My Work page to manage your work
If you’re using Visual Studio Premium or Visual Studio Ultimate, you can use the My Work page in Team Explorer to manage your work. In Team Explorer, choose Home, and then choose My Work.
You can use My Work to:
Track your work against tasks
Suspend and later resume your work (including file changes, associated tasks, and Visual Studio state such as window positions and breakpoints)
Request a code review
For a step-by-step example, see Day in the Life of an ALM Developer: Write New Code for a User Story, and Day in the Life of an ALM Developer: Suspend Work, Fix a Bug, and Conduct a Code Review.
Tips
You can control the kinds of work items that appear in the Available Work Items section. You can choose one of the default options, or you can choose any of your personal queries that are contained in the root My Queries folder. To work with these queries, in Team Explorer choose Home, and then choose Work Items.
When you move a work item to Available, In Progress, or Suspended, the work item state or comments are updated so that your team is automatically advised on the status of your work. For example, the task board for your team is updated to show your status. See Agile Planning and Iterations.
If your team project contains customized work item type definitions, you might have problems using My Work, unless an Administrator for your team project has taken certain steps. See Customize Process Configuration and Update a Customized Process Template to Access New Features.
Use the Pending Changes page to manage your work
You can use the Pending Changes page in Team Explorer to manage your work. In Team Explorer, choose Home, and then choose Pending Changes. The Pending Changes page is also displayed whenever you begin the check-in process.
Almost every change that you make to the files on your dev machine is stored in your workspace as a pending change until you check it in:
Work with automatically detected changes
If you are working in a local workspace, Visual Studio can detect changes that you make outside the system. If you edit a file outside Visual Studio (for example, in Notepad) the change automatically appears in your Included Changes.
If you add or remove a file outside Visual Studio, for example, in Windows Explorer (File Explorer in Windows 8), the Detected changes link appears in the Excluded Changes section. Choose this link if you want to include these changes. The Promote Candidate Changes dialog box appears. You can open the shortcut menu of added items and choose Browse in Windows Explorer to display them or Delete from disk to delete them.
Note
Empty folders will not appear.
If items that you don’t need to check in are appearing regularly in the Promote Candidate Changes dialog box, you can select one of them, open its shortcut menu, and choose Ignore this local item to ignore the item. You can also choose Ignore by extension or Ignore by file name to create a file that will cause Visual Studio to systematically ignore this kind of file. For more information on .tfignore files, see Add Files to the Server.
See what you changed
Sometimes you need to remind yourself about what you’ve changed in a file.
To see what you changed from Pending Changes
On the Pending Changes page, open the shortcut menu for the item and choose:
Compare with Workspace Version to see what you’ve changed to the version in your workspace
Compare with Latest Version to see how your changes compare to the latest version of the file in your team’s codebase
To see what you changed from Solution Explorer or from Source Control Explorer
Locate and select the item in Solution Explorer or in Source Control Explorer.
Open the shortcut menu for the item, and then choose Compare.
On the Compare dialog box, from the Type menu, choose:
Workspace Version to see what you’ve changed to the version in your workspace
Latest Version to see how your changes compare to the latest version of the file in your team’s codebase
One of the other options: Changeset, Date, or Label.
Choose OK.
The Diff window appears. See Compare Files.
Undo your pending changes
You can discard one, a few, or all of the pending changes in your workspace.
Note
A few other options:
-
You can first put the changes away in a shelveset on your server before removing them from your workspace.
-
If you have already checked in the change and want to revert it, see Roll Back Changesets.
To undo a few of your pending changes
In Solution Explorer, the Pending Changes Window, or Source Control Explorer, select one or more items, open their shortcut menu and choose Undo or Undo Pending Changes.
Tip
To undo all changes you have made in your solution or a code project, open the shortcut menu, and then choose Undo Pending Change.
In the Undo Pending Changes dialog box, make sure the changes you want to undo are selected, and then choose Undo Changes.
To undo all your pending changes
- On the Pending Changes page, choose the Actions link, and then choose Undo All.
Use the command prompt
Status Command: Display pending changes in the command prompt.
Checkin Command: View pending changes in the Check In dialog box.
Undo Command: Undo pending changes.
Tip
You can use this command to undo another user’s check-out if you have sufficient permissions.
Difference Command: See what you have changed in a file.
Tips
If you are new to developing an app with Visual Studio and Team Foundation Server: Walk step by step with an agile team as they collaborate to develop an app.
If you are beginning a new task, it is probably a good idea for you to download the latest files from the server before you check out files and begin your work.
To request a code review of your pending changes, on the Pending Changes page, choose Request Review. See Day in the Life of an ALM Developer: Suspend Work, Fix a Bug, and Conduct a Code Review.
If you need to set aside your changes, see Suspend Your Work and Manage Your Shelvesets.
When you are ready check in and add your changes to the team’s codebase, see Check In Your Work to the Team's Codebase.
Use Source Control Explorer to manage your files in version control. Also see: Manage Files and Solve Problems.