Step 6: Configure typemap settings | Admin
By default, P4 attempts to automatically detect if files should be stored as text or binary data, and sets all files to read-only until you check them out. To ensure that P4 Server handles files with specific extensions or files in specific folders in a specific way, set up a typemap. A typemap can also let you limit the number of versions of a file stored on the server, which saves server space.
If you are configuring P4 Server with a game engine, you must set up a typemap to ensure that binary assets can only be edited by one person at a time.
If you are not configuring P4 Server with a game engine, read through the information on this page and determine whether you need a typemap or not.
On this page:
Configure a typemap
Complete the following steps to configure the typemap.
-
At a command prompt, enter
p4 typemapand press Enter.The typemap opens in your default text editor.
The typemap must open in its own window. Iftypemap not savedis displayed, close all instances of your text editor and run the command again. Ifp4 client erroris displayed, make sure that you are using the correct P4PORT, including the hostname or IP and port for your P4 Server.-
To view your default P4 settings, type
p4 set. -
To change the P4PORT value, type
p4 set P4PORT=correct server addresswherecorrect server addressis the P4 Server IP address or and port, for example,192.168.0.1:1666 or p4d-1.example.com:1666. Then, enterp4 setagain to view the new values you set.
-
-
Under the
TypeMap:add lines for each file extension or path.To learn more, see Syntax. If you are using P4 with a game engine, you can use examples in Universal game engine typemap.
-
Save the typemap file and close the text editor.
If the typemap is valid,
Typemap savedis displayed at the command prompt. If the typemap is invalid, an error is displayed indicating that the typemap was not saved.
Syntax
Each line in the typemap has two parts, with a space between each part.
In the first part, there is a file type or modifier, or both.
-
You can specify a file type first, such as
binaryortext, and then use+to add modifiers. For example,binary+w. -
If you have more than one modifier in a line, do not add
+between modifiers. For example,binary+wl.
In the second part, there is a depot path pattern.
-
Start a pattern with
//, followed by the depot path and either*for all files in the folder or a specific file pattern. Always use forward slashes. For example,//..._BuiltData.uasset. -
Use
...as a wildcard to match any number of characters in any subfolders. -
Use
*as a recursive wildcard to match any number of characters, but no subfolders,
For example, binary+wS2 //..._BuiltData.uasset indicates that:
-
The server detects any files ending with
_BuiltData.uassetin any depots, streams, and subfolders as binary data. -
Files ending in
_BuildData.uassetin workspaces are writable. -
The server keeps only the two most recent versions of files ending in
_BuiltData.usasset.
For more typemap examples, see Examples and Define filetypes with p4 typemap in P4 Server Administration Documentation.
Common modifiers
The following are common typemap modifiers. For a complete list, see File types in the P4 CLI Reference.
| Modifier | Description | Use this for: |
|---|---|---|
w
|
Keeps files writable in workspaces. By default, files are read-only until they are checked out. | Files that are updated automatically that you want to track, such as log and build files. |
l
|
Set exclusive locking for files. When the file is checked out, it is automatically locked so others cannot edit it. | Binary files, such as game engine files, 3D models, images, and movies that cannot be merged. These files should not be edited by multiple users at the same time. |
S#
|
Only stores the most recent versions of the file. Replace # with the number of revisions to keep. For example, +S2 stores the most recent two versions. |
For large files and files that change often to save space on the server. |
Examples
The following example typemap:
-
Treats all
.metafiles as binary, regardless of the file contents. -
Treats all
.exefiles as binary, makes them always writable, and only stores the latest revision on the server. -
Exclusively locks any
.objfiles in theproject_adepot, does not lock any other files, and lets P4 automatically determine the file type.CopyTypeMap:
binary //....meta
binary+wS //....exe
+l //project_a/....obj
Use the following typemap to get started with Unreal Engine, Unity 3D, or Godot. It also includes exclusive lock settings for common binary files.
# Perforce File Type Mapping Specifications.
#
# TypeMap: a list of filetype mappings; one per line.
# Each line has two elements:
#
# Filetype: The filetype to use on 'p4 add'.
#
# Path: File pattern which will use this filetype.
#
# See 'p4 help typemap' for more information.
TypeMap:
text+l //....md5anim ## Unity3D files that should be locked
text+l //....md5mesh ## Unity3D files that should be locked
text+l //....meta ## Unity3D files that should be locked
text+w //....config ## Auto-updated files - reconcile offline work carefully
text+w //....deps.json ## Auto-updated files - reconcile offline work carefully
text+w //....DotSettings ## Auto-updated files - reconcile offline work carefully
text+w //....ini ## Auto-updated files - reconcile offline work carefully
text+w //....json ## Auto-updated files - reconcile offline work carefully
text+w //....log ## Auto-updated files - reconcile offline work carefully
text+w //....modules ## Auto-updated files - reconcile offline work carefully
text+w //....pdm ## Auto-updated files - reconcile offline work carefully
text+w //....runtimeconfig.json ## Auto-updated files - reconcile offline work carefully
text+w //....target ## Auto-updated files - reconcile offline work carefully
text+w //....uatbuildrecord ## Auto-updated files - reconcile offline work carefully
text+w //....uproject ## Auto-updated files - reconcile offline work carefully
text+w //....version ## Auto-updated files - reconcile offline work carefully
text+w //....xml ## Auto-updated files - reconcile offline work carefully
binary+Fl //....avi ## Already compressed - store uncompressed and lock
binary+Fl //....bz2 ## Already compressed - store uncompressed and lock
binary+Fl //....gif ## Already compressed - store uncompressed and lock
binary+Fl //....gz ## Already compressed - store uncompressed and lock
binary+Fl //....jar ## Already compressed - store uncompressed and lock
binary+Fl //....jpeg ## Already compressed - store uncompressed and lock
binary+Fl //....jpg ## Already compressed - store uncompressed and lock
binary+Fl //....mov ## Already compressed - store uncompressed and lock
binary+Fl //....mpg ## Already compressed - store uncompressed and lock
binary+Fl //....rar ## Already compressed - store uncompressed and lock
binary+Fl //....tif ## Already compressed - store uncompressed and lock
binary+Fl //....tiff ## Already compressed - store uncompressed and lock
binary+Fl //....zip ## Already compressed - store uncompressed and lock
binary+l //....a ## Standard binary - store compressed and lock
binary+l //....aac ## Standard binary - store compressed and lock
binary+l //....aar ## Standard binary - store compressed and lock
binary+l //....aas ## Standard binary - store compressed and lock
binary+l //....ae ## Standard binary - store compressed and lock
binary+l //....ai ## Standard binary - store compressed and lock
binary+l //....aiff ## Standard binary - store compressed and lock
binary+l //....anim ## Standard binary - store compressed and lock
binary+l //....apk ## Standard binary - store compressed and lock
binary+l //....asset ## Standard binary - store compressed and lock
binary+l //....bik ## Standard binary - store compressed and lock
binary+l //....bin ## Standard binary - store compressed and lock
binary+l //....blend ## Standard binary - store compressed and lock
binary+l //....bmp ## Standard binary - store compressed and lock
binary+l //....bnk ## Standard binary - store compressed and lock
binary+l //....btr ## Standard binary - store compressed and lock
binary+l //....celtx ## Standard binary - store compressed and lock
binary+l //....cfm ## Standard binary - store compressed and lock
binary+l //....class ## Standard binary - store compressed and lock
binary+l //....clip ## Standard binary - store compressed and lock
binary+l //....controller ## Standard binary - store compressed and lock
binary+l //....cubemap ## Standard binary - store compressed and lock
binary+l //....dae ## Standard binary - store compressed and lock
binary+l //....data ## Standard binary - store compressed and lock
binary+l //....dds ## Standard binary - store compressed and lock
binary+l //....demo ## Standard binary - store compressed and lock
binary+l //....doc ## Standard binary - store compressed and lock
binary+l //....docx ## Standard binary - store compressed and lock
binary+l //....dot ## Standard binary - store compressed and lock
binary+l //....ear ## Standard binary - store compressed and lock
binary+l //....fbx ## Standard binary - store compressed and lock
binary+l //....flac ## Standard binary - store compressed and lock
binary+l //....fnt ## Standard binary - store compressed and lock
binary+l //....ibl ## Standard binary - store compressed and lock
binary+l //....ico ## Standard binary - store compressed and lock
binary+l //....ip ## Standard binary - store compressed and lock
binary+l //....light ## Standard binary - store compressed and lock
binary+l //....lighting ## Standard binary - store compressed and lock
binary+l //....lwo ## Standard binary - store compressed and lock
binary+l //....m4a ## Standard binary - store compressed and lock
binary+l //....ma ## Standard binary - store compressed and lock
binary+l //....mask ## Standard binary - store compressed and lock
binary+l //....mat ## Standard binary - store compressed and lock
binary+l //....mb ## Standard binary - store compressed and lock
binary+l //....mp3 ## Standard binary - store compressed and lock
binary+l //....mp4 ## Standard binary - store compressed and lock
binary+l //....navmesh ## Standard binary - store compressed and lock
binary+l //....obj ## Standard binary - store compressed and lock
binary+l //....odg ## Standard binary - store compressed and lock
binary+l //....odp ## Standard binary - store compressed and lock
binary+l //....ods ## Standard binary - store compressed and lock
binary+l //....odt ## Standard binary - store compressed and lock
binary+l //....ogg ## Standard binary - store compressed and lock
binary+l //....otf ## Standard binary - store compressed and lock
binary+l //....otg ## Standard binary - store compressed and lock
binary+l //....ots ## Standard binary - store compressed and lock
binary+l //....ott ## Standard binary - store compressed and lock
binary+l //....overrideController ## Standard binary - store compressed and lock
binary+l //....pac ## Standard binary - store compressed and lock
binary+l //....pdf ## Standard binary - store compressed and lock
binary+l //....physicMaterial ## Standard binary - store compressed and lock
binary+l //....png ## Standard binary - store compressed and lock
binary+l //....ppt ## Standard binary - store compressed and lock
binary+l //....pptx ## Standard binary - store compressed and lock
binary+l //....prefab ## Standard binary - store compressed and lock
binary+l //....prefab.unity ## Standard binary - store compressed and lock
binary+l //....psb ## Standard binary - store compressed and lock
binary+l //....psd ## Standard binary - store compressed and lock
binary+l //....raw ## Standard binary - store compressed and lock
binary+l //....renderTexture ## Standard binary - store compressed and lock
binary+l //....res ## Standard binary - store compressed and lock
binary+l //....response ## Standard binary - store compressed and lock
binary+l //....roq ## Standard binary - store compressed and lock
binary+l //....rpt ## Standard binary - store compressed and lock
binary+l //....shadow ## Standard binary - store compressed and lock
binary+l //....skp ## Standard binary - store compressed and lock
binary+l //....so ## Standard binary - store compressed and lock
binary+l //....sxw ## Standard binary - store compressed and lock
binary+l //....tar ## Standard binary - store compressed and lock
binary+l //....terrain ## Standard binary - store compressed and lock
binary+l //....tga ## Standard binary - store compressed and lock
binary+l //....tres ## Standard binary - store compressed and lock
binary+l //....ttf ## Standard binary - store compressed and lock
binary+l //....u ## Standard binary - store compressed and lock
binary+l //....uasset ## Standard binary - store compressed and lock
binary+l //....udk ## Standard binary - store compressed and lock
binary+l //....umap ## Standard binary - store compressed and lock
binary+l //....unity ## Standard binary - store compressed and lock
binary+l //....unitypackage ## Standard binary - store compressed and lock
binary+l //....upk ## Standard binary - store compressed and lock
binary+l //....war ## Standard binary - store compressed and lock
binary+l //....wav ## Standard binary - store compressed and lock
binary+l //....webm ## Standard binary - store compressed and lock
binary+l //....wma ## Standard binary - store compressed and lock
binary+l //....wmv ## Standard binary - store compressed and lock
binary+l //....xls ## Standard binary - store compressed and lock
binary+l //....xlsx ## Standard binary - store compressed and lock
binary+w //....app ## Build output - stays writable, be sure to reconcile offline work
binary+w //....dll ## Build output - stays writable, be sure to reconcile offline work
binary+w //....dylib ## Build output - stays writable, be sure to reconcile offline work
binary+w //....exe ## Build output - stays writable, be sure to reconcile offline work
binary+w //....exp ## Build output - stays writable, be sure to reconcile offline work
binary+w //....ipa ## Build output - stays writable, be sure to reconcile offline work
binary+w //....lib ## Build output - stays writable, be sure to reconcile offline work
binary+w //....pdb ## Build output - stays writable, be sure to reconcile offline work
binary+w //....rc ## Build output - stays writable, be sure to reconcile offline work
binary+w //....stub ## Build output - stays writable, be sure to reconcile offline work
binary+w //....ubulk ## Build output - stays writable, be sure to reconcile offline work
binary+w //....uexp ## Build output - stays writable, be sure to reconcile offline work
text+x //....sh ## Make executable for mac and linux
text+x //....command ## Make executable for mac
binary+wS2 //..._BuiltData.uasset ## Large regenerable files - keep 2 versions, be sure to reconcile offline work
Use the following typemap to get started with Unreal Engine, Unity 3D, or Godot. This typemap is configured to store binary files as uncompressed so you can use delta transfer with P4. Delta transfer can improve the speed and bandwidth usage for submitting and syncing binary files, but the uncompressed files will take up slightly more space on your server. To learn more, see Delta Transfer of large binary files in the P4 Server Administration Documentation.
# Perforce File Type Mapping Specifications.
#
# TypeMap: a list of filetype mappings; one per line.
# Each line has two elements:
#
# Filetype: The filetype to use on 'p4 add'.
#
# Path: File pattern which will use this filetype.
#
# See 'p4 help typemap' for more information.
TypeMap:
text+l //....md5anim ## Unity3D files that should be locked
text+l //....md5mesh ## Unity3D files that should be locked
text+l //....meta ## Unity3D files that should be locked
text+w //....config ## Auto-updated files - reconcile offline work carefully
text+w //....deps.json ## Auto-updated files - reconcile offline work carefully
text+w //....DotSettings ## Auto-updated files - reconcile offline work carefully
text+w //....ini ## Auto-updated files - reconcile offline work carefully
text+w //....json ## Auto-updated files - reconcile offline work carefully
text+w //....log ## Auto-updated files - reconcile offline work carefully
text+w //....modules ## Auto-updated files - reconcile offline work carefully
text+w //....pdm ## Auto-updated files - reconcile offline work carefully
text+w //....runtimeconfig.json ## Auto-updated files - reconcile offline work carefully
text+w //....target ## Auto-updated files - reconcile offline work carefully
text+w //....uatbuildrecord ## Auto-updated files - reconcile offline work carefully
text+w //....uproject ## Auto-updated files - reconcile offline work carefully
text+w //....version ## Auto-updated files - reconcile offline work carefully
text+w //....xml ## Auto-updated files - reconcile offline work carefully
binary+Fl //....avi ## Already compressed - store uncompressed and lock
binary+Fl //....bz2 ## Already compressed - store uncompressed and lock
binary+Fl //....gif ## Already compressed - store uncompressed and lock
binary+Fl //....gz ## Already compressed - store uncompressed and lock
binary+Fl //....jar ## Already compressed - store uncompressed and lock
binary+Fl //....jpeg ## Already compressed - store uncompressed and lock
binary+Fl //....jpg ## Already compressed - store uncompressed and lock
binary+Fl //....mov ## Already compressed - store uncompressed and lock
binary+Fl //....mpg ## Already compressed - store uncompressed and lock
binary+Fl //....rar ## Already compressed - store uncompressed and lock
binary+Fl //....tif ## Already compressed - store uncompressed and lock
binary+Fl //....tiff ## Already compressed - store uncompressed and lock
binary+Fl //....zip ## Already compressed - store uncompressed and lock
binary+Fl //....a ## Store uncompressed for Delta Transfer
binary+Fl //....aac ## Store uncompressed for Delta Transfer
binary+Fl //....aar ## Store uncompressed for Delta Transfer
binary+Fl //....aas ## Store uncompressed for Delta Transfer
binary+Fl //....ae ## Store uncompressed for Delta Transfer
binary+Fl //....ai ## Store uncompressed for Delta Transfer
binary+Fl //....aiff ## Store uncompressed for Delta Transfer
binary+Fl //....anim ## Store uncompressed for Delta Transfer
binary+Fl //....apk ## Store uncompressed for Delta Transfer
binary+Fl //....asset ## Store uncompressed for Delta Transfer
binary+Fl //....bik ## Store uncompressed for Delta Transfer
binary+Fl //....bin ## Store uncompressed for Delta Transfer
binary+Fl //....blend ## Store uncompressed for Delta Transfer
binary+Fl //....bmp ## Store uncompressed for Delta Transfer
binary+Fl //....bnk ## Store uncompressed for Delta Transfer
binary+Fl //....btr ## Store uncompressed for Delta Transfer
binary+Fl //....celtx ## Store uncompressed for Delta Transfer
binary+Fl //....cfm ## Store uncompressed for Delta Transfer
binary+Fl //....class ## Store uncompressed for Delta Transfer
binary+Fl //....clip ## Store uncompressed for Delta Transfer
binary+Fl //....controller ## Store uncompressed for Delta Transfer
binary+Fl //....cubemap ## Store uncompressed for Delta Transfer
binary+Fl //....dae ## Store uncompressed for Delta Transfer
binary+Fl //....data ## Store uncompressed for Delta Transfer
binary+Fl //....dds ## Store uncompressed for Delta Transfer
binary+Fl //....demo ## Store uncompressed for Delta Transfer
binary+Fl //....doc ## Store uncompressed for Delta Transfer
binary+Fl //....docx ## Store uncompressed for Delta Transfer
binary+Fl //....dot ## Store uncompressed for Delta Transfer
binary+Fl //....ear ## Store uncompressed for Delta Transfer
binary+Fl //....fbx ## Store uncompressed for Delta Transfer
binary+Fl //....flac ## Store uncompressed for Delta Transfer
binary+Fl //....fnt ## Store uncompressed for Delta Transfer
binary+Fl //....ibl ## Store uncompressed for Delta Transfer
binary+Fl //....ico ## Store uncompressed for Delta Transfer
binary+Fl //....ip ## Store uncompressed for Delta Transfer
binary+Fl //....light ## Store uncompressed for Delta Transfer
binary+Fl //....lighting ## Store uncompressed for Delta Transfer
binary+Fl //....lwo ## Store uncompressed for Delta Transfer
binary+Fl //....m4a ## Store uncompressed for Delta Transfer
binary+Fl //....ma ## Store uncompressed for Delta Transfer
binary+Fl //....mask ## Store uncompressed for Delta Transfer
binary+Fl //....mat ## Store uncompressed for Delta Transfer
binary+Fl //....mb ## Store uncompressed for Delta Transfer
binary+Fl //....mp3 ## Store uncompressed for Delta Transfer
binary+Fl //....mp4 ## Store uncompressed for Delta Transfer
binary+Fl //....navmesh ## Store uncompressed for Delta Transfer
binary+Fl //....obj ## Store uncompressed for Delta Transfer
binary+Fl //....odg ## Store uncompressed for Delta Transfer
binary+Fl //....odp ## Store uncompressed for Delta Transfer
binary+Fl //....ods ## Store uncompressed for Delta Transfer
binary+Fl //....odt ## Store uncompressed for Delta Transfer
binary+Fl //....ogg ## Store uncompressed for Delta Transfer
binary+Fl //....otf ## Store uncompressed for Delta Transfer
binary+Fl //....otg ## Store uncompressed for Delta Transfer
binary+Fl //....ots ## Store uncompressed for Delta Transfer
binary+Fl //....ott ## Store uncompressed for Delta Transfer
binary+Fl //....overrideController ## Store uncompressed for Delta Transfer
binary+Fl //....pac ## Store uncompressed for Delta Transfer
binary+Fl //....pdf ## Store uncompressed for Delta Transfer
binary+Fl //....physicMaterial ## Store uncompressed for Delta Transfer
binary+Fl //....png ## Store uncompressed for Delta Transfer
binary+Fl //....ppt ## Store uncompressed for Delta Transfer
binary+Fl //....pptx ## Store uncompressed for Delta Transfer
binary+Fl //....prefab ## Store uncompressed for Delta Transfer
binary+Fl //....prefab.unity ## Store uncompressed for Delta Transfer
binary+Fl //....psb ## Store uncompressed for Delta Transfer
binary+Fl //....psd ## Store uncompressed for Delta Transfer
binary+Fl //....raw ## Store uncompressed for Delta Transfer
binary+Fl //....renderTexture ## Store uncompressed for Delta Transfer
binary+Fl //....res ## Store uncompressed for Delta Transfer
binary+Fl //....response ## Store uncompressed for Delta Transfer
binary+Fl //....roq ## Store uncompressed for Delta Transfer
binary+Fl //....rpt ## Store uncompressed for Delta Transfer
binary+Fl //....shadow ## Store uncompressed for Delta Transfer
binary+Fl //....skp ## Store uncompressed for Delta Transfer
binary+Fl //....so ## Store uncompressed for Delta Transfer
binary+Fl //....sxw ## Store uncompressed for Delta Transfer
binary+Fl //....tar ## Store uncompressed for Delta Transfer
binary+Fl //....terrain ## Store uncompressed for Delta Transfer
binary+Fl //....tga ## Store uncompressed for Delta Transfer
binary+Fl //....tres ## Store uncompressed for Delta Transfer
binary+Fl //....ttf ## Store uncompressed for Delta Transfer
binary+Fl //....u ## Store uncompressed for Delta Transfer
binary+Fl //....uasset ## Store uncompressed for Delta Transfer
binary+Fl //....udk ## Store uncompressed for Delta Transfer
binary+Fl //....umap ## Store uncompressed for Delta Transfer
binary+Fl //....unity ## Store uncompressed for Delta Transfer
binary+Fl //....unitypackage ## Store uncompressed for Delta Transfer
binary+Fl //....upk ## Store uncompressed for Delta Transfer
binary+Fl //....war ## Store uncompressed for Delta Transfer
binary+Fl //....wav ## Store uncompressed for Delta Transfer
binary+Fl //....webm ## Store uncompressed for Delta Transfer
binary+Fl //....wma ## Store uncompressed for Delta Transfer
binary+Fl //....wmv ## Store uncompressed for Delta Transfer
binary+Fl //....xls ## Store uncompressed for Delta Transfer
binary+Fl //....xlsx ## Store uncompressed for Delta Transfer
binary+Fw //....app ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....dll ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....dylib ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....exe ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....exp ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....ipa ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....lib ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....pdb ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....rc ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....stub ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....ubulk ## Build output - stays writable, Delta Transfer enabled
binary+Fw //....uexp ## Build output - stays writable, Delta Transfer enabled
text+x //....sh ## Make executable for mac and linux
text+x //....command ## Make executable for mac
binary+FwS2 //..._BuildData.uasset ## Large regenerable files - keep 2 versions, Delta Transfer enabled
What's next
Next, create a stream depot, the highest level of organization on a P4 Server.