Set up and create the ignore file

By default, Helix Core wants to version all of your files. For game engine builds, you may need Helix Core to ignore some of the files, such as individual user settings, caches, and so on.

Use the following instructions to set up Helix Core to ignore files, create the ignore file, and then submit the ignore file.

Set up Helix Core to ignore files

In order to use an ignore file, we need to tell our local Helix Core client where to look for an ignore file. This is done by setting the P4IGNORE environment variable or by using the p4 set command.

For this example, let’s decide to call our ignore files .p4ignore by opening a terminal or command prompt and typing the following:

p4 set P4IGNORE=.p4ignore

Note
  • If both environment and p4 set variables exist, environment variables take precedence over p4 set variables.

  • Each user needs to run the ignore command to set their P4IGNORE variable, unless the system admin has already set that Environment Variable for them on their machine.

  • You can enter p4 set in your terminal or command prompt to see all variables set in your environment and where they are set.

Create the ignore file

Now that Helix Core knows to look for a file called .p4ignore in the workspace, we can create the ignore file.

  1. To create a .p4ignore file, open your Notepad or text editor and save a blank file with name .p4ignore inside your workspace root folder. For example: C:\Users\YourName\Perforce\Yourname_Workspace\.p4ignore

    Note

    There should not be a .txt extension on this file because we set P4IGNORE to just .p4ignore. If you want to use a .txt extension, you can use p4 set P4IGNORE=.p4ignore.txt or any other name you want.

  2. In your text editor, write one line for each file path you want ignored. Note that:

    • Paths are case-sensitive.

    • * can be used as a wildcard to match any number of characters.

    • Putting a / at the end of a path will only match directories. Otherwise it will match any files OR directories with the same characters.

    • A ! at the beginning of a line will make sure that matches files are not ignored, even if a previous rule matches them.

    Tip
    • Be sure you understand what is being ignored so you don’t accidentally ignore something you don’t want to (or you accidentally ignore something you should be storing in your depot).

    • As Helix Core is case-sensitive, double check your paths to make sure you are using consistent cases.

    • For a more complete explanation, see the P4IGNORE Documentation.

    See the following example ignore file for Unreal Engine:

    # User-specific folders or temporary files that should not be versioned.
    Saved/
    Intermediate/
    DerivedDataCache/
    FileOpenOrder/
    obj/
    # Certain file types that should not be versioned. *.pdb *-Debug.*
    # Visual Studio user settings files that should be ignored. .vs/
  3. Save the file and test it out. Choose from the following methods:
    • In P4V, add the file that should be ignored. You will get a pop-up messing telling you the file is ignored.

    • Use the p4 ignores command in the terminal:

      p4 ignores -i -v the_path_to_the_file_you_want_to_check

      The output will tell you if the file was ignored or not and will tell you which line in the ignore file is the one that matched. You can test out any hypothetical path to check if they would be ignored or not.

Submit the ignore file

To submit your ignore file:

  1. In P4V, click on the .p4ignore file in the workspace.

  2. Click the Add button on the toolbar, or right-click the file and select Mark for Add. This will add the file to the default changelist.

  3. With the file selected, click the Submit button on the toolbar, or right-click the file and select Submit….

  4. Write a description for your changelist, such as “Added ignore file”, then click Submit.

Your ignore file is now saved in the depot and other users will have the same ignore file in their workspaces when they sync their files.

Note

The administrator or user will still need to set up their local client to use the ignore file.