Query TFS for updated files - tfs

I want to get an overview of files that are updated in TFS (that someone else checked in) that I don't have the latest version for.

In Visual Studio Source Control Explorer, right click on the directory you want to compare, and select "Compare". It will pop up a dialog with a couple of filtering options, and then show you what's out of date.

if they checked them in as part of a single changeset then you can find them that way.
(right click file in solution explorer, view history, double-click on the relevant changeset and you'll see all the related files for that checkin)
Is your question about finding this info via the TFS API via the website, or via the visual studio interface?

Related

TFS Visual Studio 2017: Search for a file by name in source control

Our application code is spread over many dozens of folders in a nested hierarchy, and we have several hundred files making up the application.
So I wanted to know if there is a way to search for files by their name in the Visual Studio 2017 version of TFS ?
I spotted Q & A as per:
TFS: Search for a file by name in source control
but this answer seems no longer applicable for TFS and Visual Studio 2017.
I can, of course use tools outside of TFS (like the "Search Everything" app) and then navigate to the same folder and file in TFS.
I just felt that surely there must be a way of doing this file search within TFS ?
I have tried the search option in Team Explorer but I'm not sure how to use this ... not sure if this works ?
i.e.
There should be a search bar at the top of the TFS site that looks something like this you can enter all sorts of filter like those in the picture. Or you can search in files but that will only look at what you have checked out at the moment and not all over TFS. If you don't see the Search bar, it might be because your TFS Administrator did not install the search extension. You might want to contact him/her.
There is not any out of box feature to do this in Visual Studio 2017/Team Explorer2017 directly. If you want to search folders/files by name:
For TFS 2017, you can use Code Search if it's been configured by
your TFS admin. This is through web portal, more details please refer
this doc-- Search your code
For earlier TFS versions, you can create a local workspace and "get"
that specific version locally. Then use the built in search in your
OS (such as Windows file explorer) to find what you are looking for.
Hope this helps.

Visual Studio 2015 - Merge tool button missing

I'm having problems with merge tool in Visual Studio 2015. I didn't need the merge tool for the longest time, I haven't used it for couple of months. Now when I need it I can't find it. I was trying to google and find an answer, checking VS settings but with no success. I can only see buttons 'Overwrite Local File or Folder' and 'Keep Local File Contents'. When I press Compare button, I see diff tool but I'm not able to accept changes (check buttons are missing).
What am I doing wrong? How can I merge two files?
Please navigate to files in source control
Right click on file/folder you want to branch>>Merge
Full list of other solutions.
This is because these files in your local folder are not been tracked by TFS Version Control. For example, you added a file "readme.txt" in you local folder and hadn't check-in them into version control. Another people in your team also added this file in the same relative path and checked it into version control. Now, when you get the latest version or check in your changes, you will get the behavior as your screenshot. A similar question can be found here: TFS Conflict Type: Writable File - A writable file by same name exists locally
It's doing exactly the same things in Visual Studio 2017.
If you had a problem in workspace and you rollback it from a save, you can have the same issue.
You need to rebind some of the project by yourself first like the asked question here : Re etablish TFS source control bindings, then if all is going well you will see the button.
If it's not working, try to use external merge tool which will allow you to edit thoses files.

Visual Studio Team Services Monitor User

So far I was working my my project myself using Visual Studio Team Services using VS 2012, everything was good. Now I have added another user for my project and things are NOT working as I expected, below are my basic questions.
After my developer is done adding/editing files, does he needs to tell me the ChangeSet # to refer to? so I can get his Check-in's?
How Can I see What files he modified/Added? And is there a way I can get only the changes I want from the user instead of getting his/her entire changeset/files?
"Get Latest Version" does not really gets me the Latest Version of files which my developer modified.
See below answers:
After my developer is done adding/editing files, does he needs to tell me the ChangeSet # to refer to? so I can get his Check-in's?
--> He doesn't need to give you Changeset# to get latest(his check-ins). You can go to Team Explorer --> Source Control Explorer and then right click on your project and select "View History" to look at all the changes done to the project. Do you see his changes in the history? If yes then "Get Latest Version" should work. Sometimes what happens if you try to get latest version in Visual Studio Solution and if the files changed are not part of solution you won't get those files. In those cases you need to get latest from Source Control Explorer.
How Can I see What files he modified/Added? And is there a way I can get only the changes I want from the user instead of getting his/her entire changeset/files?
--> If you double click on the changeset after following the above steps to go to View History you will see all the files changed. If you want to get only few files from a check-in you will have to get the latest at file/folder level instead of getting it at project level. i.e. Find out all the files changed using above method and then go to individual files/folders in the Source Control Explorer to get latest.

Why are all files write protected and how can I check-in?

I currently work with a Team Foundation Server and Visual Studio. Since two days, I keep getting error messages that I can't write to files (it seems not to matter which file I try to access). I am the only one in my team who has those problems.
So when I try to check-in, I get:
When I click on Overwrite, I can overwrite it. But when I try to check-in pending changes, I don't see any changes. If I modify a source file, I can compare it to the latest version and see that there are changes.
How can I fix this? I simply would like to work ...
Work-around: If I "Check Out for Edit..." the file (so I get the lock) I can edit it. But this doesn't work for the solution file, because somebody else checked it out.
Go to Solution Explorer
Right click on your solution
Click Go online
It seems that your solution is not connected to the Team Foundation Server.
I would recommened that you remove the mapping of your workspace, delete all local files of the workspace and then get a fresh version (Get latest version) from the Team Foundation Server.
To remove mapping you need to open the Source Control Explorer in Visual Studio. Navigate to the Branch you are working on and open the Context Menu (right click on branch). In the menu you select Advanced->Remove mappings....
In the dialog you can edit or remove the mapping of your workspace. (Note: When you select Remove mapping then will all files in the Local Folder be removed that are controlled by TFS)
What you also can do is to check the state of your workspace/solution if it is connected to TFS. To do that you need to open the solution in Visual Studio and then open File->SourceControl->Advanced->Change Source Control... in the File Menu of Visual Studio.
In the Dialog you will see if your Solution and projects are connected to TFS and the server they are connected to
You should have the correspondings local files like in the source control.
Go to the local file, right click on it and choose Properties,
in the opened dialog uncheck the read-only checkbox, click Yes to the question if you want to apply changes to all subfolders and files.
Hope this is helpful.
You will face the same problem when setting your Workspace location to server (which in my case happened somehow magically).
To change the location to local again open the source control explorer and in the upper part you find a drop down labeled "Workspace". From this drop down choose "Workspaces...". This opens the "Manage Workspaces" dialog where you can select your workspace and click the "Edit" button. In the Edit dialog click the "Advanced" button and you'll see a drop down for Location where you can change it to Local again.
MSDN provides detailed information on the pros and cons of local and server workspaces.

How to browse TFS changesets?

I want to browse TFS changesets.
I do NOT want to search changesets by specifying a file contained within the changeset. I do not want to specify which user I think created the changeset.
I simply want to key in a changeset number and look at that changeset. Or maybe view a range, and then browse those.
No specified file, no specified user. TFS 2008 seems to not want to allow me to do this.
I must be missing something.
How do you do this?
In Source Control Explorer, hit CTRL+G. This will bring up the Find Changesets dialog. Unfortunately it's kind of one-size-fits-all in VS 2008: you have to work inside a big bulky search dialog, even if you already know the number(s). In your case, flip the radio button to search by range and then key in the desired changeset number as both the start & end of the range.
The VS 2010 version of this dialog simplifies the "lookup single changeset by #" use case, FWIW.
My personal preference: if you have a console window open, there's a quicker route. Simply type tf changeset 12345. If using the Power Tools, you can substitute "Get-TfsChangeset" or "tfchangeset" for improved performance and programmability.
in the Source Control Explorer window, right-click on any folder in the source control tree and select View History. this will give you a list of changesets that touch that folder (recursively). It's not a way to key in a changeset, but it's another easy way to see changesets
you can also right click on a folder and select Find in Source Control -> Changeset... which will allow you to enter a changeset number or range.
** these might be part of TFS Power Tools
On the website which is provided by TFS or on Visual Studio Online, go to your team home page. Then on that page click on the link Code then Changesets which after loading provides a list of the historical change-sets.
Steps
1. Open Visual studio and find Team Explorer(right hand side of computer screen).
2. Click on Team Explorer and Look for Source Control Explorer.
3. Now Click on Source Control Explorer.
4. Now Press CTRL+G
5. Changeset popup will come up.
6. Enter Changeset Number.
7. Click OK button of Changeset Popup.
8. Changeset Details will come up.
Thanks... :)

Resources