3

Visual Studio 2017 (v15.9.9).

I can't seem to figure out how to create a .tfignore file. If I do it manually, windows tells me I need to add a file name. And I am not seeing anywhere via the IDE to create one.

I'm used to GIT, where I can right click on a pending check-in file (that has changed) and just select "Ignore". But I don't seem to have that option, despite the fact that all the results I find via Google tell me that I should.

Daniel Mann
  • 49,975
  • 11
  • 87
  • 105
Casey Crookston
  • 10,362
  • 17
  • 70
  • 150
  • Technically not a dupe I guess since it's for a .gitignore, but should still work: https://stackoverflow.com/questions/10744305/how-to-create-gitignore-file/53093031 – Broots Waymb Mar 18 '19 at 18:52
  • @BrootsWaymb, can you make that an answer? :) – Casey Crookston Mar 18 '19 at 18:55
  • If you have a local workspace, you can add a new file and in the bottom of the pending changes window you have the changes you can 'promote'. In that window, you can right click the files to automatically add them to a .tfignore file that will be created for you. – Alexander Derck Mar 18 '19 at 19:00

3 Answers3

3

You can create your file as .tfignore.. The last dot will be removed automatically.

Daniel Mann
  • 49,975
  • 11
  • 87
  • 105
manaszon
  • 188
  • 1
  • 7
3

This can be solved using the same steps as How to create .gitignore file (just replace .gitignore with .tfignore):

Create the text file tfignore.txt Open it in a text editor and add your rules, then save and close Hold SHIFT, right click the folder you're in, then select Open command window here Then rename the file in the command line, with ren tfignore.txt .tfignore

However, an easier/quicker way to get around this Windows Explorer error is by appending a dot to the filename without extension: .tfignore. will be automatically changed to .tfignore

Daniel Mann
  • 49,975
  • 11
  • 87
  • 105
Broots Waymb
  • 4,178
  • 3
  • 25
  • 47
  • 2
    I edited your answer because `.tfsignore` is not the correct file name -- it is `.tfignore`. Note the lack of an "S". – Daniel Mann Mar 18 '19 at 20:58
  • Thanks @DanielMann. I'm only familiar with the .gitignore equivalent, so was just going off of the info in OP's post. – Broots Waymb Mar 18 '19 at 20:59
2

the easiest way is to open command prompt and navigate to your project folder. Then

notepad .tfignore

after that just save file and you are good to go.

Or you can also use

echo "" > .tfignore

Note that you may need to manually include this file to TFS

Daniel Mann
  • 49,975
  • 11
  • 87
  • 105
Derviş Kayımbaşıoğlu
  • 24,022
  • 2
  • 42
  • 59