Excluding imports from version control

Because Flare import files include timestamps and absolute paths, they are a frequent source of merge conflicts in environments with multiple contributing authors (each of whom might periodically reimport content, which updates their local import file). For that reason, excluding the import file from source control can simplify version control operations. Excluding the imported content itself can also reduce the size of your repository, making version control operations faster.

To exclude imports from version control

  1. In a text editor, create a new file and then copy and paste the following name-matching patterns to the file:
Copy
### MadCap Flare import exclusions ###
Common.flvar
Common.flcts
Common.flimpfl
/**/Common/
  1. Save a copy of the file in the top-level folder of each Flare project that imports content from the common project, using the file name .gitignore.
  2. Add, commit, and push your changes to add the .gitignore files to the repository.

This file causes Git to ignore the following files and directories in each Flare project:

  • The Common variable set, Common conditional tag set, and the Common import file.

Note   These names assume that you followed the guidance in Creating the common project; because these three files aren't stored in a Common subfolder, they are named explicitly in the ignore file.

  • All files contained within a Common subfolder. The folder organization of the common project, combined with this matching pattern, allows you to easily ignore all other shared components imported from the common project.

As described in Excluding specified files from version control, the .gitignore file does not apply retroactively to content already added to the repository. If you already committed and pushed the Common.flimpfl file or any imported content to the Git repository in one or more projects, you must first delete those files (and commit and push the changes); the .gitignore file then prevents those files from being re-added to version control.

Now that you've improved writer efficiency by single-sourcing content, lets look at how to further improve efficiency by automating project builds.