TFS File comparison report tool - tfs

I often compare DEV and MAIN branches and would like to run a report to show these results. I manually run the compare and copy and past the results into excel. Is there a more efficient way to do this?

You can use the command line tool tf.exe to compare a visual representation of the differences between files in two server folders, in a server folder and a local folder, or in two local folders:
tf folderdiff sourcePath targetPath /recursive [/noprompt]
/noprompt option means tf folderdiff runs without displaying user
interface. The output is displayed in the Command Prompt window
instead.

Related

TFS: Overwrite (ALL) local file or folder

I'm trying to get latest on Visual Studio 2017/Angular project on a another machine and hence getting latest all files. It is taking a long time to 'Overwrite local file or folder' individually. Isn't there a way to Overwrite All local files or folders with single click?
In Visual Studio, from the Source Control Explorer, open the folder you want to overwrite. Use Advanced..., Get Specific Version...
And check the option "Overwrite writable files..."
Optionally check "Overwrite all files", but that should not be required and can take up more time.
You can also do this from the commandline:
tf vc get $/project/path /recursive /overwrite /version:T
And optionally to overwrite all files even if your system thinks they are unchanged:
tf vc get $/project/path /recursive /overwrite /force /version:T
Alternatively, you can use undo pending changes to revert to the last checked-in version, or scorch to clear files that aren't even checked in:
tf vc undo /recursive $/Project/path
and
tf vc scorch /recursive $/project/path

Let Jenkins build from multiple TFS repositories

I have a problem with Jenkins building my source code. I'm using a lib repo and a repo for my code. I want Jenkins to build the project if anything in one of the repos changes.
Does anyone has some pointer how to solve this? I managed to get it working in the case that everything is in only one repo, but I want to separate the lib and the project code.
Unfortunately,the TFS pluging for Jenkins currently does not support checking out the sources from multiple locations.
However, as a work around you could use the command line to create any sort of workspace that you like, and even copy a template workspace that you have lying around.
To achieved this use both TF and the powershell Snapin Microsoft.TeamFoundation.PowerShell.
Basically the workflow is as follows :
Get-TFsWorkspace (Powershell : To check for the workspace)
TF Workspace /new (To Create a workspace)
TF Workfold /unmap (use this to remove the default $/ mapping which is
made during workspace creation)
TF Workfold /map (To map specific locations, ie $/Repo/project)
TF Scorch (to remove any artifacts if there are any)
TF Get (To get the code)
More details please refer this answer in a similar question.

Can I set the File Time option for a TFS workspace with the tf.exe workspace command?

I would like to set the option File Time = Checkin on workspaces that are created with the tf.exe workspace command. In the Visual Studio 2013 Workspaces editor there is a field for this setting in the Advanced section and it defaults to Current Time.
The build server is creating workspaces with tf.exe and getting the code which then timestamps all the files to current time but I would like them to be time stamped with the last checkin time.
Is it possible to set this option on the command line so I that can include it in my build process?
BTW: If I get the timestamps to match last checkin I can speed up the copy process when deploying my websites by only copying the newer files. Currently it just copies everything even it is has not changed because the timestamps change on every build.
You can configure the file time setting with the filetime option. For example:
tf workspace MYWORKSPACE /filetime:checkin

tf diff on server items shows local changes not server

I am running the TF Diff command to get differences between two branches. I run the following command:
tf difference $/myVersionControl/Branch1 $/myVersionControl/Branch2 -recursive
The only differences that show up are the ones in the working directory and only the top level directory. its almost like it does not recursively look inside. What am I doing wrong here? I can get a list of all the diffs if I do it from Team Explorer just fine. I am assuming Team Explorer is using TF Diff under the covers but I could be wrong.
I am using TFS 2008.
If there is a powershell equivalent - that would be perfect because i want to pipe the output and have a few more things to do with these changes.
tf folderdiff $/Branch1/ $/Branch2/ -recursive > output.txt
To use the difference command, you must have the Read permission for all specified items set to Allow.

TFS command line to get all mapping information of a specific workspace

I am trying get all maping information for a specific workspace.
When I try this command, it displays a dialog - which is not what I want.
tf workspace myworkspace
Is there a command that will get all the working folder information and output to the console?
The following command displays the working folder mappings for the workspace in the current directory:
C:\projects>tf workfold
If you want to list the working folder mappings for a different workspace, you can specify the /workspace:workspacename parameter.
C:\>tf workfold /workspace:My_Other_Workspace
You can manipulate the workspace mappings using this command also.
The following example maps the folder C:\DifferentWorkfold to the Team Foundation version control server folder $/projects/project_one
c:\projects>tf workfold $/projects/project_one C:\DifferentWorkfold
See Tf Command-Line Utility - Workfold Command on MSDN for more information
In TFS 2008 and TFS 2010, the command
C:\projects>tf workfold
would indeed display the working folder mappings for the workspace in the current directory.
However, for TFS 2012, this command no longer works.
Now, you just get an error message:
Unable to determine the workspace. You may be able to correct this by
running the command 'tf workspaces /collection:TeamProjectCollectionUrl'
If I knew the TeamProjectCollectionUrl then I wouldn't need to run the workfold command!

Resources