How do I find my shelved changes in tfs Visual Studio 2008? - tfs

I am new to TFS, and I have shelved some changes of my code, however now I need to get those changes and continue working on my project. How can I find my shelveset on VS2008 (this is the version of vs that I have to use for my project) and how can I start using it so I can continue with my project?
I tried righ click on the projects file in Source Control, but the option Find is not available unlike VS2015.
Thank you in advance!

The Visual Studio 2008 docs are still online. The Unshelve button is hidden in the Pending Changes window and in the File->Source Control menu in the top-level menu bar of visual studio.
Whereas you can restore a changeset into a workspace using the Get command, you must use the Unshelve Command to restore a shelveset. You can use the Unshelve button in the Pending Changes window to restore one, some, or all the pending changes in a shelveset to your workspace. For more information about the Pending Changes window, see How to: Check In Pending Changes. When you unshelve all the changes in a shelveset to a workspace using Visual Studio, the pending changes information with which the items are associated is restored to the Pending Changes window also.
See: Shelve and unshelve pending changes
Generally, when the UI is confusing, consider falling back to the commandline tools:
From any folder in your workspace from a visual studio command prompt:
# List Shelves
tf shelvesets
# Unshelve
tf unshelve "shelveset name"
You can also use a newer version of Visual Studio to do your source control interactions and develop from Visual Studio 2008.

Related

Why did a TFS merge auto-merge a file, instead of prompting me to manually merge the file?

We are currently using TFS 2015 for source control and project management. We're also using Visual Studio 2019. The team I'm on has a main branch in TFS, with branches off main for development isolation. Today I merged the main branch into my dev branch. During the process TFS/VS 2019 informed me that there was a conflict in one file, Proficiency.cs. However, TFS auto-merged the file. After I checked in the changes, I looked at Proficiency.cs. It was wrong, the version in my dev branch didn't have the changes that it should have from the main branch.
Why didn't TFS give me a chance to review the conflict? Is it because we're using TFS 2015? Or is there some step or configuration in VS 2019 I should set to allow me to review the conflict?
By default the system automatically attempts to AutoResolve All conflicts. To change the option, from the menu bar choose Tools, Options, and then in the Options dialog box, navigate to Source Control, Visual Studio Team Foundation Server. Clear the Attempt to automatically resolve conflicts when they are generated checkbox.
More details, check documentation below:
https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/resolve-team-foundation-version-control-conflicts?view=azure-devops

Accidentally deleted branch from TFS - Undelete and Rollback not available?

I'm using Visual Studio 2015 and have deleted a branch from our TFS source control. Looking at other guides there's mention of being able to recover the branch by opening Source Control Explorer, right-click and select 'Undelete' or 'Rollback'. These options are not available
I have not got this branch mapped on any workspace. Clicking on 'Undo Pending Changes...' brings up a message saying there are no pending changes. How can I restore a branch on TFS? Is there a way I can enable Undelete or Rollback?
First, please make sure you or your teammates haven't destroyed this branch (After doing this, there is no way to recover it in TFS server).
If you delete this branch in Visual Studio,
To restore an item deleted from the server
From the menu bar choose Tools, Options.
On the Options dialog box, navigate to Source Control, Visual
Studio Team Foundation Server.
Select Show deleted items in the Source Control Explorer, and then
choose OK.
From the menu bar choose View, Other Windows, Source Control
Explorer.
In Source Control Explorer, navigate to the folder that contains the
item you want to restore.
Open the item’s context menu (select the item and right-click it) and
then choose Undelete.
If you delete this branch from your dev machine outside of Visual Studio,
Please check the solution from MSDN link Delete or restore files and folders
Morever, you can also try to use the undelete command restores items that were previously deleted. For Example:
tf undelete [/noget] [/lock:(none|checkin|checkout)]
[/recursive] itemspec[;deletionID] [/login:username,[password]]
Update:
Note: To be able to undelete a branch you must first map the parent folder/branch to your workspace. Now, the undelete option will be enable.
According to the screenshot, there is no workspace configured for it. Try configuring a work space for the project that include the deleted branch to see if the "Undelete" option will be activated.
In Visual Studio go to [Tools->Options] then Select [Source Control->visual Studio Team Founation Server] and check the [Show deleted items in the Source Control explorer].
After that, you can then right click a folder and say "Undelete"

Visual Studio 2015 How to restore packages?

So my team mate commited some code in TFS and he added some new references. However these would not want to download even if the checkbox is checked insite the nuget package settings. So I tried deleting all the references from the solution explorer. How can I get them back as well as whatever my team mate commited to TFS?
right click on solution>source control>get specific version to undo changes.
If that doesn't bring your deleted files, you need to go to:
Tools->Options->Source Control->Visual Studio Team Foundation, then check
"Show deleted items in the Source Control Explorer"
checkbox.
Go to source control where your deleted files where located right click>source control>get specific version

TFS file must remain locked

I have some 3rd party dlls checked into TFS
Our machines were renamed and now TFS believes they are checked out for edit by me on another machine.
I tried tf lock /lock:none contrib64/* /workspace:oldmachine;myusername but I get the error
TF10152: The item $/XXX/YYYY/contrib64/third_party.dll must remain
locked because its file type prevents multiple check-outs.
1, Is there any way around this ?
2, Is TFS really this bad or is it just me ?
3, Is the purpose of TFS to make us nostalgic for VSS?
ps It's a hosted version so I can't just get the admin to fix it.
Undoing the lock won't work on those files because they are binary, as binaries cannot be merged they must be locked if they are checked out.
As the machine the workspace resides on no longer exists (the machine has been renamed) the best thing to do is delete the workspace.
from a Visual Studio command prompt
tf workspace /delete oldmachine;myusername /collection:http://*tfsserver*:8080/tfs/*collection*
This will remove the workspace and undo all pending changes
If you don't want to delete the workspace, you can undo the change and unlock the file after that:
Using a Visual Studio developer command prompt:
tf undo "$/<server-path-to-file/folder>" /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive
tf lock "$/<server-path-to-file/folder>" /lock:none /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive
Files with .dll extension as well as other extensions like .exe, .doc, .docx, etc. are automatically locked because (as mentioned) here they cannot be merged.
If you want to disable the automatic lock and allow these files to go through gated check-in, follow the steps below:
Log in to your build server.
Open visual studio.
In team explorer, log into your team project.
Go to "Settings".
Under "Team Project Collection", select "Source Control".
Set "File Merging" property to "Disabled" for any file extension you don't want to be automatically locked.
Reference: https://blogs.msdn.microsoft.com/phkelley/2008/11/12/everything-you-ever-wanted-to-know-about-locks/
This worked for me.
I needed to change settings in 2 places:
At Visual Studio, team project window, Settings->Team Project Collection -> Source Control
Enable File Merging for the extension.
2) At Visual Studio, team project window, Settings->Team Project -> Source Control
Enable the multiple check-out box

How to revert (Roll Back) a checkin in TFS 2010

Can anyone tell me how to revert (roll back) a checkin in TFS 2010?
You have two options for rolling back (reverting) a changeset in Team Foundation Server 2010 Version Control. First option is using the User Interface (if you have the latest version of the TFS 2010 Power Tools installed).
The other option is using the TFS 2010 version control command-line application:
tf.exe rollback
I have information about both approaches on my blog post.
For Team Foundation Server 2012, 2013, or Visual Studio Online, rollback is now built-in directly to Source Control Explorer and when you are opening a changeset's details in the Team Explorer Window. You do not need to install any release of the Power Tools for this functionality when using Visual Studio 2012 or later. There is a great MSDN article discussing details about rolling back a changeset now available here: http://msdn.microsoft.com/en-us/library/ms194956(v=vs.110).aspx
For 2010, use the rollback command from the command line. There is not integrated support in the IDE for this, as of yet.
Rollback command
Basically, the way that it works is that it creates an "anti-delta" to negate the impacted changeset. You can accomplish the same thing manually by doing a Get Specific Version, adding a space to the file so it looks like it changed, and checking it in. I still go the latter route to back out a change if I need to for a single file, as I find it quicker to do.
Without using power tools or command line:
ensure Tools->Options->Source Control->Visual Studio Team Foundation Server UNCHECK Get latest version of item on check out
View the history of project folder in Source Control Explorer and right click on the changeset to roll back to and choose Get This Version
Check out for edit on the project folder in the Source Control Explorer (this should keep your local version you just got from the history)
Check in pending changes on the project folder in the Source Control Explorer
if visual studio asks you to resolve conflicts, choose keep local and attempt check in of pending changes on the project folder in Source Control Explorer again
Rolling back changes for another user
If you are attempting to rollback changes for another user, make sure you get latest on the files you are attempting to rollback; otherwise you will see the error:
"No changes to roll back."
You can rollback a changeset (in TFS2010) through command line doing:
Open CMD or Visual Studio Command Prompt
Change directory to your workspace folder. Example: cd C:\myWorkspace
Run following tf command (where 123 is changeset number)
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
Go to Pending Changes window to check files marked with edit,rollback and do a Check In.
Note: you must use tf.exe full path even in Visual Studio Command Prompt to avoid "Unable to determine the workspace" error. More info here
Rollback reference (TFS 2010)
https://msdn.microsoft.com/en-us/library/dd380776(v=vs.100).aspx
right click file in Visual Studio and Source Control/View History
then select last changeset, right click and click Rollback
After rollback done, you should check in again.
There is no undo option in TFS (up untill 2008, I haven't used 2010 yet).
There are some command line power tools you can use to rollback changes that may help:
http://msdn.microsoft.com/en-us/library/ms194956%28VS.80%29.aspx
HTH

Resources