Every time I want to check my code into my VSTS repository, I need to tell Visual Studio 2017 to exclude a few folders such as node_modules, wwwroot/dist, etc.
How do I mark these folders as excluded so that VS doesn't have to ask me every time I need to check my code in?
You can use a .tfignore file as described here to achieve it in team foundation version control (tfvc). If you are using Git version control with VSTS it is gitignore.
Related
I am attempting to create an extension that will periodically check to see if the user has the latest version of all files in a specific project or branch. This specific project/branch is going to be determined by what item is checked out for editing. The reason for creating this extension is to create reminders every time a file becomes unsynced. This will prevent merging into items that are out of date.
I am also working with Gated Check-ins, so it would be advantageous if I could check for latest version after a gated build succeeds.
I am having trouble finding the APIs for TFS integration when making an extension for visual studio. I am also having trouble finding an API to use to make a direct TFS extension. I am assuming this is because everything that has to do with TFS commands should be done using TFS command line commands.
I am running TFS and VS 2015.
Thanks in advance for the help!
You can use NuGet packages of TFS API:
Microsoft.VisualStudio.Services.Client
Microsoft.TeamFoundationServer.Client
Microsoft.TeamFoundationServer.ExtendedClient
All the DLL's also stored in the following location, you can take them and use in your project:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
A good tutorial on how to use the API you can find here.
I have a VERY large project which just went through an upgrade process. The upgrade is a process external to Visual Studio. As a result, files that are deleted by the upgrade process do not get properly detected by TFS so TFS pukes on checkin saying that it can't find the file.
The problem is that there are several hundred files that need to be excluded to resolve the issue. I could do this for days before I'm done. I'm pretty sure my boss would prefer it not take several days.
Is there a quick way to find and automate the exclusion of these files so I can just be done with it?
You have two options...
Use a Local Workspace - if you go into the settings of your Workspace you can change it from Server to Local. This will allow the changes to be detected automatically. You may need to copy everything out and then back in if you have already made the changes...
Reconcile the difference - You can use the TFS 2013 Power Tools and the "tfpt online /adds /deletes /diff /noprompt /recursive directory-name" command...How to have TFS 2010 detect changes done to files outside of Visual Studio?
My ultimate goal of this exercise is to update TFS code repository from the contents (i.e., files and folders) which are getting copied from another source.
Following is the exact scenario in my project:
There exists a code repository in VSTS Online
Have setup Jenkins on my local computer.
Configured Jenkins to create a workspace for TFS code.
Written powershell scripts in the build step to copy files from another source to the workspace folder configured for TFS.
Till this point everything is working fine. In the next step, I want to update TFS repository from whatever is there in the workspace.
Any idea of how I can achieve this?
Thanks,
Nirman
You can try to use tf command with a script during the build just like Stefan suggested.
If you want to use Windows Explorer to manage TFS version control files, you can also try to use Microsoft Visual Studio Team Foundation Server 2015 Power Tools. Which allow you to check-in and check-out through folders.
You need to: First, create a workspace folder, put your project in this folder.
Then use Windows Shell Extensions coming with TFSPowerTools2015 to check in/check out files in the local workspace folder.
I have been using the Webstorm trial version for a month and it has expired, so now I am considering using Visual Studio.
However, I have come across a stumbling block using ankhsvn, which is that I cannot figure out how to "import" files from existing files in subversion and add them to a project. Add to Subversion simply adds a new folder to the repo and I cannot see the existing files in the project explorer.
Is there a newbie friendly tutorial on how to import files from an existing svn repo to a solution in local space?
D'oh! Turns out I just needed to use Tortoise to check out the files, then create a blank solution in the same folder as the check out (this is important or ankhsvn won't play nice), and then add existing website to the project.
I am trying to perform a complicated merge between branches of the same solution. We use Team Foundation Server, but I would prefer compare folders locally with WinMerge instead of relying on TFS directly to tell me what changed. The problem is, there are a lot of files that are not in source control which pollute the WinMerge folder comparison: bin, obj, static code analysis files, remaining projects that were created locally but discarded and never deleted...
I could delete local folders and force get from source control to clean it, but I'm connected to the source control through a slow VPN and it could take a while; or I could also manually delete whichever files I think are duplicate, but that is too empirical to be exhaustive.
So here's my question: is there any tfs command to clean local folders?
In 2015 tfpt has since been deprecated. After downloading the 2015 TFS Power Tools the new command is:
tf reconcile /clean /recursive .
The ending dot assumes your Developer Command Prompt is sitting at the root directory in your workspace you wish to start from, and /recursive assumes you want to include all subdirectories.
When you run the command it will pop up a preview of all changes it will make, and give you the opportunity to cherry-pick which ones you'd like to keep, if not all.
Note: pending files will not be included in the results, which is usually what you want. If you want to remove them as well, you should undo your pending changes first.
You can use the:
tfpt scorch
..command for this purpose. the TFPT command line is part of the TFS Power Tools
For Visual Studio 2017, there is no Power Tools but the good news is that most of the features are moved into TFS 2017. Therefore, you can simply use the following without installing any tools.
tf vc reconcile /clean /recursive .
No, there is no command. As far as the version control doesn't know about the files that are not added to the version control, it cannot delete them.