Excluding specified files from version control
You can exclude specific files from version control by adding one or more .gitignore files to the repository. Each .gitignore file specifies the files that you want to exclude from version control. The .gitignore file can name folders or files explicitly, or use pattern matching to exclude files that match a specified filter (for example, files with a given extension). When defined, the .gitignore file affects all files in the current directory and applies recursively to all subdirectories. This allows you to ignore files across the full repository by defining a .gitignore file in the repository's top-level folder, and ignore project-specific files by defining another .gitignore file in a project's directory.
The first .gitignore file that you create will be a repository-wide (that is, top-level) file that ignores Flare-generated files that should typically be excluded from version control.
Note
- If you are using a different authoring tool than Flare, check the documentation for your tool to find which files are recommended for exclusion from version control.
- The .gitignore file prevents new files with a matching name from being added to the repository but it doesn't retroactively affect matching files that were previously added to the repository (before you added the .gitignore file).

When defining the .gitignore file, you can use the characters defined in the following table to specify a matching pattern:
Character | Description |
---|---|
/ |
The forward slash is a directory separator and can occur anywhere in the pattern. |
* |
A single asterisk is a wildcard character that matches a number of characters except a forward slash. You can use range notation [a-zA-z] to narrow the matching range. |
? |
A question mark is a wildcard character that matches any single character except a forward slash. You can use range notation [a-zA-z] to narrow the matching range. |
** |
Leading double asterisks means match in all directories. For example, **/home matches a file or directory named home regardless of its parent directory. |
! |
A leading exclamation mark negates the subsequent pattern. Tip Because lower-level .gitignore files override higher-level .gitignore files, you can use the exclamation mark to override a previously defined exclusion. |
# |
A leading hashtag is treated as a comment, and the rest of the line is automatically ignored. |
For more details and examples of pattern matching, see the gitignore documentation.
Note You only need to perform the following procedure once, on any client computer that has cloned the Git repository. The .gitignore file then becomes available to all client computers when they next pull remote changes from the remote repository.
To exclude specified Flare files from being added to the Git repository
- In a text editor, create a new file and then copy and paste the following name-matching patterns to the file:
### MadCap Flare file exclusions ###
**/Output/
**/Analyzer/
**/FileSync/
**/Project/Users/
**/Project/Reports/
- Save the file in the top-level folder of the Git repository using the file name .gitignore.
Tip If your editor adds an automatic extension to the file name (such as .txt), you'll need to rename the file to remove that extension.
This file causes Git to ignore the following directories in each Flare project:
- Output - Contains compiled output targets (such as generated PDF files, HTML5 projects, or CHM files).
- Analyzer - Contains temporal data describing warnings or problems detected during the most recent project analysis scan in Flare.
- FileSync - Contains mappings between Flare projects and integrated external sources.
- Project/Users - Contains metadata about a user's Flare sessions (for example, recently used items).
- Project/Reports - Contains reports generated from within Flare (for example, a report displaying details about conditional tag usage within a Flare project).
The content of each of these directories is automatically generated and shouldn't be stored in version control.
You are now ready to add (that is, stage), commit, and push the file to the remote Git repository.