JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Use multiple Perforce depots with P4CONFIG

Last modified: 17 June 2024

If your project contains directories that are stored in the different Perforce depots, you might need to switch between them. JetBrains Rider uses P4CONFIG to automatically switch to the respective depot as you use a Perforce-versioned directory.

P4CONFIG is an environment variable that contains the name of the P4CONFIG file without the path. If a certain directory is associated with Perforce (refer to Version control integration support), JetBrains Rider seeks for the P4CONFIG file in this directory and its parents; if the file is not found, JetBrains Rider looks for it in the bin directory of JetBrains Rider installation. When a P4CONFIG file is found, JetBrains Rider uses the settings contained in it to connect to the respective Perforce depot.

A sample P4CONFG file might consist of the following lines: