Excluding Files and Directories from Source Control

You can configure the Dimensions for Eclipse Plug-in to exclude specified files from source control. You can configure Eclipse to ignore (exclude) your back up or temp files, which will help eliminate unnecessary files from your Dimensions CM project.

The Dimensions for Eclipse Plug-in has two options for ignoring files from source control:

The standard Eclipse preferences ignores files based on a global preference setting. The standard preferences uses a pattern match to determine if files should be ignored. The preferences automatically searches any derived resources, however it has some deficiencies. The standard preferences test only leaf names after containers have been expanded, which means that certain patterns will not get ignored as intended. For example, specifying temp* will ignore files called temp, temp.txt temperance.txt but it will not ignore files in a directory temp or any subdirectories of temp. A second limitation is that specifying temp.txt will ignore it across all projects and directories. It may be necessary to ignore just one particular file with the name.

The .dmignore file ignores files and directories based on the entries in the .dmignore file. This file contains project-specific ignore patterns which will be used in addition to the standard preferences. dmignore supports wildcards and pattern matching for both files and directories. A .dmignore file applies to all files and directories in the folder in which it is located; however it doesn't apply to subfolders. For example, if .dmignore contained the entry temp* and you had the following structure:

 

project

.dmignore

temp.txt

temp/file1.txt

dir1/temp1.txt

 

The temp.txt file and the temp folder (and its subfolder) would be ignored. The temp1.txt file would be included because it is in a subfolder. To ignore this file, you would add an additional .dmignore file in the dir1 subfolder.

TIP  
Serena recommends that you place the .dmignore files under source control.

When you perform a source control activity, such as synchronizing a project, the integration runs the ignore checks based on the selection context. The following rules apply to the checks:

Excluding Files Using the .dmignore File

You can use the .dmignore file to exclude files from source control activities. This file can be used independently or in addition to the standard Eclipse ignore preferences. See Excluding Files and Directories from Source Control for more information.

NOTE  
You can still explicitly add files to source control even though you have added them to the ignore lists.

To exclude specified files or folders using the .dmignore file, either:

Click OK and the entry is added to the .dmignore file in the root of your project. If the .dmignore file does not exist, it will be created.

Excluding Files Using Standard Eclipse Preferences

You can use the standard Eclipse preferences to exclude files from source control. The preferences can be used independently or in addition to the .dmignore file. See Excluding Files and Directories from Source Control for more information.

NOTE  
You can still explicitly add files to source control even though you have added them to the ignore lists in Dimensions projects.

To exclude specified files using the standard Eclipse preferences:

  1. Select Window | Preferences. The Preferences dialog box appears.

  2. Click the plus sign next to Team and select Ignore Resources.

  3. Examine the Ignore Patterns list for the file type you wish to exclude from source control. If it is not listed, do the following:

    1. Click the Add button. The Enter Ignore Pattern dialog box appears.

    2. Enter a pattern that defines a file type to ignore. Use wildcards if needed:

    3. Click OK.

  4. In the Ignore Patterns list, ensure that a check mark appears next to each file type you want to exclude from source control.

  5. Click OK.