Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude a folder from checkin TFS online

i am using visualstudio.com as TFS online and have created my code repo there.

In my project there is folder that comprises several subfolders and eachsub folder has several images (the total of all images is like 6000).

When i check-in my code I do not want the root folder (i.e. the parent folder of image subfolders) and its content to be checkedin?

I tried online for some answers but cannot find anything accurate.

Thanks in advance for your help.

like image 207
user1144596 Avatar asked Jul 16 '17 06:07

user1144596


1 Answers

You can configure which kinds of files are ignored by placing text file called .tfignore in the folder where you want rules to apply. The effects of the .tfignore file are recursive. However, you can create .tfignore files in sub-folders to override the effects of a .tfignore file in a parent folder.

To create the file, the easiest way is using 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.

pending changes, Detected changes link , which counts the number of adds, in this case 50003 add(s) (I have a busy directory clearly!)

The Promote Candidate Changes dialog box appears.

  1. Select a file, open its context menu, and choose Ignore this local item, Ignore by extension, Ignore by file name, or Ignore by folder.

the promote candidate changes dialog opens. right-clicking an item in its list includes options like "Ignore by extension *.js"

  1. Choose OK or Cancel to close the Promote Candidate Changes dialog box.
  2. 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.

the .tfignore is automatically created by Visual Studio  and appears in pending changes with the "add" notation, suggesting you will commit it

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

like image 120
PatrickLu-MSFT Avatar answered Oct 19 '22 08:10

PatrickLu-MSFT