Documentation

Support

Unity Version Control

Configure lock rules

Configure the lock rules for exclusive checkouts.
Read time 2 minutesLast updated 21 days ago

Use one of the following methods to add or edit your Unity Version Control (UVCS) lock rules to configure your file locks:

Configure lock rules in the server administration console

  1. Launch the server administration console.
  2. Select Configuration > Lock rules.
  3. Add or edit global rules for all repositories, or repository specific rules to apply to specific repositories.

Add global rules

  1. Select Generate common rules.
  2. Either load the common lock rules or edit them to specify your own global rules.
  3. Select Apply.

Add repository specific rules

  1. Select Add to specify the rules for a repository.
  2. Enter the name fo the repository.
  3. Select Generate common rules and edit to specify your own rules.
  4. Select Delete to remove rules for a repository if you don't need them. Select Apply.

Configure lock rules in the
lock.conf
file

Create or edit the
lock.conf
file on the server directory in the following format:
rep:<repname> [br:[<destination_branch>]] [excluded_branches:<exclusion_pattern>…]

Parameters

Description

repname
The name of the repository where that repository specific lock rules apply to. You can also use
*
to apply global rules to all repositories.
destination_branch
The source of truth when you create a new lock. UVCS considers the revision in this branch as the last revision. Locked files in other branches are not released until you merge them back into the destination branch. The default destination branch is
/main
.
exclusion_pattern
A pattern of files to exclude from lock rules that might represent a full branch name, for example
/main/experiment
, or a pattern with wildcards, for example,
/main/experiments/*
,
/main/experiment-*
, or
*/art-concepts/*
.
To configure the paths that lock on checkout, specify complete paths or patterns, with each rule in a new line: In the following example, you ensure that all
*.png
pictures and all files under the
/assets/textures
folder that begin with
model
lock on checkout in the
battlegame
repository.
rep:battlegame br:/main*.png/assets/textures/model*.*

Example
lock.conf
file

rep: * br:/main# Audio and video formats*.mkv*.mp3*.mp4*.ogg*.wav*.wave# Image formats*.bmp*.jpg*.jpeg*.png*.gif*.eps*.exif*.icns*.ico*.psd*.ai*.svg*.pcxrep: doom3src br:/main excluded_branches: /main/experiment /main/experiments/* */art-concept */art-concepts/***/sys/*.xlib*.def

Example lock rules for specific cases

You can use lock rules to lock files or a directory in a specific folder. For examples for how to use these types of lock, refer to the following:

Rule

Description

/prj/Assets/Standard Assets/Toon Shading
Lock everything under the
/prj/Assets/Standard Assets/Toon Shading
folder.
/prj/Assets/Standard Assets/Tree Creator/Trees/Big*.meta
Lock everything under the
/prj/Assets/Standard Assets/Tree Creator/Trees
folder that begins with Big and ends with
.meta
.
!/prj/Assets/Standard Assets/Tree Creator/Trees/BigTree_textures.meta
Never lock the
BigTree_textures.meta
file under the
/prj/Assets/Standard Assets/Tree Creator/Trees
folder. This rule overwrites the previous one/
**/Library/*.prefs
Lock every file that ends with
.prefs
and is under any folder called
Library
.