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 typemap
and press Enter.The typemap opens in your default text editor.
The typemap must open in its own window. Iftypemap not saved
is displayed, close all instances of your text editor and run the command again. Ifp4 client error
is 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 address
wherecorrect server address
is the P4 Server IP address or and port, for example,192.168.0.1:1666 or p4d-1.example.com:1666
. Then, enterp4 set
again 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 saved
is 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
binary
ortext
, 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.uasset
in any depots, streams, and subfolders as binary data. -
Files ending in
_BuildData.uasset
in 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
.meta
files as binary, regardless of the file contents. -
Treats all
.exe
files as binary, makes them always writable, and only stores the latest revision on the server. -
Exclusively locks any
.obj
files in theproject_a
depot, 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 compressed files and media 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 files. These lines are probably unnecessary as P4 will auto-detect the type.
text //....asmdef
text //....asmref
text //....cginc
text //....cm
text //....compute
text //....cs
text //....csv
text //....editorconfig
text //....gitignore
text //....hlsl
text //....js
text //....json
text //....md
text //....package
text //....proc
text //....proc
text //....rsp
text //....shader
text //....template
text //....txt
text //....uss
text //....xml
text //....yaml
# Text files that should be locked. (These are Unity3D files)
text+l //....md5anim
text+l //....md5mesh
text+l //....meta
# Text files that should remain writable (often automatically updated)
# Be EXTRA SURE to reconcile offline work to make sure they are submitted properly.
text+w //....config
text+w //....DotSettings
text+w //....ini
text+w //....log
text+w //....modules
text+w //....pdm
text+w //....target
text+w //....uatbuildrecord
text+w //....uproject
text+w //....version
# Binary files to lock and to store uncompressed (because they are likely already compressed)
binary+Fl //....avi
binary+Fl //....bz2
binary+Fl //....gif
binary+Fl //....gz
binary+Fl //....jar
binary+Fl //....jpeg
binary+Fl //....jpg
binary+Fl //....mov
binary+Fl //....mpg
binary+Fl //....rar
binary+Fl //....tif
binary+Fl //....tiff
binary+Fl //....zip
# Most binary files should be locked to avoid merge conflicts.
# Feel free to add more file endings as needed.
# Also, if you want to take advantage of Delta Transfer in P4
# you could add +F to all binaries to get faster sync/submit
# at the cost of using more storage space on the server.
binary+l //....a
binary+l //....aac
binary+l //....aar
binary+l //....aas
binary+l //....ae
binary+l //....ai
binary+l //....aiff
binary+l //....anim
binary+l //....apk
binary+l //....asset
binary+l //....bik
binary+l //....bin
binary+l //....blend
binary+l //....bmp
binary+l //....bnk
binary+l //....btr
binary+l //....celtx
binary+l //....cfm
binary+l //....class
binary+l //....clip
binary+l //....controller
binary+l //....cubemap
binary+l //....dae
binary+l //....data
binary+l //....dds
binary+l //....demo
binary+l //....doc
binary+l //....docx
binary+l //....dot
binary+l //....ear
binary+l //....fbx
binary+l //....flac
binary+l //....fnt
binary+l //....ibl
binary+l //....ico
binary+l //....ip
binary+l //....light
binary+l //....lighting
binary+l //....lwo
binary+l //....m4a
binary+l //....ma
binary+l //....mask
binary+l //....mat
binary+l //....mb
binary+l //....mp3
binary+l //....mp4
binary+l //....navmesh
binary+l //....obj
binary+l //....odg
binary+l //....odp
binary+l //....ods
binary+l //....odt
binary+l //....ogg
binary+l //....otf
binary+l //....otg
binary+l //....ots
binary+l //....ott
binary+l //....overrideController
binary+l //....pac
binary+l //....pdf
binary+l //....physicMaterial
binary+l //....png
binary+l //....ppt
binary+l //....pptx
binary+l //....prefab
binary+l //....prefab.unity
binary+l //....psb
binary+l //....psd
binary+l //....raw
binary+l //....renderTexture
binary+l //....res
binary+l //....response
binary+l //....roq
binary+l //....rpt
binary+l //....shadow
binary+l //....skp
binary+l //....so
binary+l //....sxw
binary+l //....tar
binary+l //....terrain
binary+l //....tga
binary+l //....tres
binary+l //....ttf
binary+l //....u
binary+l //....uasset
binary+l //....udk
binary+l //....umap
binary+l //....unity
binary+l //....unitypackage
binary+l //....upk
binary+l //....war
binary+l //....wav
binary+l //....webm
binary+l //....wma
binary+l //....wmv
binary+l //....xls
binary+l //....xlsx
# Binary files that should stay writable because they will be updated automatically,
# such as when building without requiring checkout first.
# Be EXTRA SURE to reconcile offline work to make sure they are submitted properly.
binary+w //....app
binary+w //....dll
binary+w //....dylib
binary+w //....exe
binary+w //....exp
binary+w //....ipa
binary+w //....lib
binary+w //....pdb
binary+w //....rc
binary+w //....stub
binary+w //....ubulk
binary+w //....uexp
# The Sn flag means the server will only keep the latest n versions of the file.
# This is useful for large files that we want to store but can be regenerated if needed.
binary+wS2 //..._BuildData.uasset
What's next
Next, create a stream depot, the highest level of organization on a P4 Server.