简体   繁体   中英

.Net Core and Typescript: how to instruct TFS to ignore generated js and js.map files

I have a .NET Core project and I want to use TypeScript. I would like to exclude the generated .js and .js.map files from my check-ins.

I have tried the tfignore approach described here , but this does not seem to work.

Any suggestion?

If it does not work then you likely already have the file under source control. You will need to remove the existing fine from source before the .ignore file will work.

If you delete the files from source control, check in, and get latest then you should not see them re-added to source control.

First, please make sure your .tfignore file created without any problem. This file does not have any suffix. One way to create it suggest you to rename a new.txt file with "tfignore." It will auto change to right .tfignore file.

You can also use the auto automatically generated .tfignore file , follow below steps:

  1. In the Pending Changes page, in the Excluded Changes section, choose the Detected changes link.

    The Promote Candidate Changes dialog box appears.

  2. Select a file, open its context menu, and choose Ignore this local item, Ignore by extension, Ignore by file name, or Ignore by folder.
  3. Choose OK or Cancel to close the Promote Candidate Changes dialog box.
  4. A .tfignore file appears in the Included Changes section of the Pending Changes page. You can open this file and modify it to meet your needs.

More info please check the Customize which files are ignored by version control from MSDN Link: Add files to the server

Second, just as MrHinsh said, it does not work when you already have the file under source control. You could try to create or generate some new js and js.map files for test. If the files already in source control you need to unbind/bind those files.

Another way to solve the issue is updating your VS to VS2015Update 3. The .tfignore should be indeed working correctly. More detail ways you can refer this blog from GitHub: Things in ".tfignore" still are shown in pending changes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM