Managing Ignore Patterns
Ignore patterns inform the version control feature about which directories, files, and file types to not include in the version control repository.
By default, the following directories and file extensions are ignored:
- /cbases/*
- /data/*
- /logs/*
- /models/*
- /staging/*
- /temp/*
- /factory-output/*
- .gitignore
- _ProductionResults*
- *.cbase
-
*.cbase-tmp-*
- *.mdl including all md* files (where * is 0–9) and mdc* continuation files
NOTE: All journal (*.jou), archive (*.archive), and log (*.log) files are ignored internally and do not display on the ignore patterns list.
Projects created with Git in release 7.1(21) or later will use a different list of default ignore patterns, based on the automatically included file WorkbenchProject.gitignore. For more information and access to the file itself, see Getting Started with Git.
The automatic default patterns ensure that you do not include large or temporary files. See Default Folder Structure for information about the directory structure and which directories do and do not default to use version control. The additional ignore patterns are set when you choose to use the automated version control feature. For more information, see Automating Version Control.
You can add other directories, file types, or specific files to this ignore list.
To add ignore patterns for projects:
-
Open the project.
-
Click Tools > Version Control > Add Ignore Pattern.
The Ignore patterns tab opens with the default ignore patterns.
-
To Add, click the white plus sign in the upper right.
A blank row is added to the Ignore patterns table.
-
Type the pattern that you want ignored in the row, and press Enter. Repeat for any additional patterns that you want to set.
NOTE:
- You can use wildcard characters, such as the asterisk (*) or question mark (?), to match multiple files. For example: *.dat and /test/*. Be advised that using only a wildcard character with no other characters in a row will cause all files to be ignored.
- Files that are already committed under version control rules are not affected by new ignore patterns.
-
Save the tab.
The additional ignore patterns are added.
NOTE:
- If there are any conflicts, the default settings take precedence over any changes in this Ignore patterns tab.
- Projects created with versions earlier than 7.0(31) use a different default directory structure. You might need to take that into account when setting up ignore patterns.
To edit an existing ignore pattern:
- Click in the row.
- Make your edits.
- Save the tab.
To remove ignore patterns:
- Select the row.
- Click Remove, which is the white minus sign in the upper right.
- Save the tab.
The Preview matched files for table displays the files that match each ignore pattern.
To preview files within the ignore patterns:
-
Open the Ignore patterns tab (Tools > Version Control > Manage Ignore Patterns) for a project that is under version control and has some additional ignore patterns set.
-
Select a row in the Ignore patterns table.
-
Select the Include already ignored files check box at the bottom of the Preview matched files for: <path> pane.
All files that match the ignore pattern display.
If you encounter difficulties with the Ignore Pattern Editor, you can use the Text Editor to modify the .gitignore file directly. Any change made in the Text Editor is reflected in the Ignore Pattern Editor.
Each line in the Text Editor is equivalent to a row in the Ignore Pattern Editor. You can toggle between the two editors at any time.