How to get a specific version from Team Foundation Server2013 "History View"? - visual-sourcesafe

I'm currently using VSS for source version control.
We are currently building the source for version control in TFS2013 in the future.
please tell me.
In the Source Control Explorer, place the cursor on the "Revert to Past Version" source, click "Right Click" and then "View History" to get the past version. The capture operation cannot be performed because it involves conflicting edits. "Is displayed. See image below
enter image description here
When I checked in, Team Explorer said, "The file was not checked in because there were conflicting changes. These conflicting changes were automatically resolved. If any changes remain, Please check in again "is displayed.
When I clicked "Check in" again, it said "All changes are either unchanged files or locks. It was undone by the change server" and I couldn't get the previous version.
I don't know why I can't get the past version.
Please tell me what to do.
Thank you.

Related

How do I add the source code to a TFS project in Visual Studio 2013?

I've got projects added to TFS in Visual Studio, with some help from here.
Now I need to add the source code (which has already been mapped, which I would think would be all that was necessary), but the project ("Report Runner") does not show the code (as "RoboReporterDataFilesGeneratorUtil" does, but I don't recall now how I got that to work).
This is what I see when I right-click "Report Runner"
When I select "Get Latest Version" says that all files are up-to-date
When I select "Check Out for Edit..." it seems to churn and choogle awhile, but even a refresh shows no addition to the contents below Report Runner
When I select "Check In Pending Changes", I see this below Team Explorer:
Selecting the "Check In" button invokes a dialog "Continue to check-in 5 items?"
Selecting "Yes" results in the following message below "Pending Changes" in Team Explorer:
"All of the changes were either unmodified files or locks. The changes have been undone by the server."
When I select "Advanced > Get Specific Version", I see this:
...but selecting "Get" there tells me, "All files are up to date. No files were updated... To force an update, use the "Get Specific Version" command with the "Overwrite all..." option checked."
But even doing that works no wonders, miracles, or even anything at all, mundane or otherwise.
So how do I add the source code from the local project so that it displays in Source Control Explorer?
UPDATE
I dragged (drug?) the source folder to C:\Users\cshannon\Source\Workspaces\ReportRunner, but failed to COPY it; it moved it, so that the source was no longer in its original place. I had to copy it back over from the users folder to its original location. However, that makes no difference - the current state of the TFS project is still exactly the same as delineated above.
NOTE: It does so "move" (rather than copy) in the official docs here.
You need to "Add the files to Source Control".
You can do this by:
Opening the Solution in Visual Studio, then right-clicking on the solution and selecting "Add Solution to Source Control" - This will miss any files that are not part of the solution.
Open Seouce Explorer, navigate to the mapped folder, and right-click in the empty space and select "Add files"
The #2 is the preferred option and will get all of the files in. Look out for files that you want to be check in ending up in the "exclusions" list...
I had to add the solution from the Solution Explorer - it doesn't seem it can all be done from the Team Explorer. So, I right-clicked the solution, selected "Add Solution to Source Control...", then "Check in..." and now the files are there in Source Control Explorer as part of the visualstudio.com meangerie.
Either I did something wrong to begin with, or this is an awfully convoluted, clunky, and possibly even kludgy way to get VS to work with TFS.
Why can't you just right-click a project and select "Create a TFS project"? Or be able to do it all from TFS? Again, this setting up of projects in TFS, copying the source over via Windows Explorer, and then making yet another step in Visual Studio seems nerdily gawky and macabre to me.
Unless (quite likely) I goofed it all up somewhere along the line. In any case, though, it could be a lot smoother. Just writin'.

TFS in Visual Studio - How to get server repo to match local repo

Disclosure: Newbie with TFS and couldn't find useful SO answers
A coworker submitted a bunch of changesets to source control -- Can I just get the most recent one to get all of his changes? Or would I need to get each one individually? In other words, do changesets compound?
And more generally, what's the easiest way to ensure my local repo is identical to the server repo (minus the new things I'm working on).
I'm much more familiar with Git if that would help explain this
With your source control set to TFS in VS (Tools > Options...) just right click on your project file in Solution Explorer and select Source Control > Get Latest Version (Recursive). I do it twice just to make sure I get a message saying "up to date".
You can also use Source Control Explorer and get a specific changeset by right clicking the change set and selecting a similar option, and yes, these will get all changes up to the one you clicked.
Edit:
A little confused rereading your title it sounds like you want the server to match local, then your question is about matching your local to the server. So let me address both.
To get the server to match your local this would be most like a "Check in" (or 'push' in Git) this will merge your files into the server. You can perform a check in by clicking the Team Explorer tab and selecting "Pending Changes" then type a description and click "Check In". Where there are conflicts your will be notified and asked how to proceed, but in most cases following best practices this will not be the case.
Then you will want to match your local with the server (basically a 'pull' in Git) by right clicking the project file and selecting 'Get Latest Version (Recursive)'
Hope this helps.

TFS 2010 - Undo "Get This Version" Action

So i click on Get This Verision (A really old one) under history by mistake and now my project has my new recent changes plus this very old changeset, but I am not sure what else might have changed (i see some of my new files created after this version with an exclamation mark)??. Is there a way I can undo the action of Get this version so my solution only has the changes I have been working on. Any help is appreciated thank you!
UPDATE: is it as easy as clicking Get Latest? That seemed to do the trick but now I still have all these conflicts to resolve from. Do i click Keep Local Version even though the description of that button says This option will replace the server version with the content from your local version. I do not want to replace the server version. I want to keep my local and leave the server version of this changeset alone
Yes, it's as easy as clicking "Get Latest". The message you're seeing is misleading. "Get Latest" only affects your local workspace, it doesn't change anything on the server side at all.

Team Foundation Server - Solution Bindings Gone Missing

I got this problem with TFS, I connected to the wrong network and tried to open a solution and it gave the error: "cannot connect to tfs". Fine, I closed the solution, and I switched to the correct network and now it says "the solution appears to be under source control but the bindings are missing bla bla."
I check the Team Explorer tab, and it shows that it's connected, but the solution, the projects lost interest in tfs somehow.
When I say "Change Source Control" and try to "Bind" all of the projects, it asks to check out every project, but I don't want to deal with conflicts now, I need my currently checked-out files.
did anyone face this problem and solve it?
Ok, I think I've found a solution:
Right-click on solution and click "Add Solution To Source Control". Then it says something like "Are you sure? This project already seems to be under some source control", click "Ignore All" for everything that pops up. And viola, your bindings are magically back in order. I really don't know why, or how. it just happened.
But this operation might checkout your solution file if it's not checked out already.

How easy is it to roll back a file that has been checked-in in TFS?

I've (apparently) checked-in (added) a file that shouldn't have been added to a branch. I need to revert this, but since then, 20 or so changesets have been added to the repository.
I'm used to working with Subversion, where it's only a few clicks and it's out. How easy is it in TFS?
TFS is a pain to use in general (personal and biased opinion). Here's a how-to article from Microsoft on how to proceed to revert changes back (warning: more than a few clicks away).
As given in that article, the steps to revert to a prior version of (a) file(s) are:
In Source Control Explorer, right-click the file whose changeset you want to roll back, and then click Get specific version on the
context menu.
In the Get dialog box, select the prior version of the file, and then click Get. For more information, see How to: Retrieve
Old Versions of Files from
Changesets.
After this file is in your workspace, right-click the file, and then click Check Out for Edit on the context menu.
Right-click the file again, and then click Check In Pending Changes.
In the Check In - Source Files dialog box, select the file, and then click Check in.
The Resolve Conflicts dialog box appears.
Click Resolve to open the Resolve version conflict dialog box.
Select Discard server changes.
Click OK.
NOTE: To review your decision before discarding the server changes, you can click Compare to view the server and local copies
simultaneously.
In the Resolve Conflicts dialog box, click Close.
In Source Control Explorer, right-click the file, and then click Check In Pending Changes.
In the Check In - Source Files dialog box, click Check in.
As #Darin has posted, you can simply Get the state of the previous version/changeset onto your PC and then check it in as a new version, thus undoing the effect of the check in. This is dead easy and can be done from the GUI, but does involve a fair bit of faffing around.
If you're happy to use the command line, you can also command TFS to rollback the changeset for you. This does all the "work" of the above option, leaving you with a changeset in your pending changes that will undo the checkin's effect, but hopefully with a bit less effort.
If it is added by mistake, you don't want to roll back. Instead, you want to tf destroy (from the command line) that file in each of the branches.
TFS can be a bear to work with if you add a file, delete it, then re-add a new file with the same name. It makes merging much more difficult.

Resources