文档

​
​

Development

User Acquisition

Monetization

工业

Unity Version Control

DevOps

On-prem

Gluon

Editor plug-in

Open Unity Dashboard

Unity Version Control

此页面不支持所选语言。
​
​
Unity Version Control
  • Overview
  • Cloud Repositories organization update
  • Installation
  • Use UVCS with the Unity Editor
  • Unity Version Control plugins
  • Concepts
    • Organizations
    • Repositories
    • Workflows and partial replicas
    • Security
    • Dynamic workspaces (Windows)
    • File explorer
    • Code reviews
    • Branches
    • Merge conflicts
    • Mergebots
    • Xlinks
    • Smart Locks
    • Symlink Support
    • Triggers
  • Tutorials
  • On-Prem
  • Gluon
  • CLI and shortcut references
  • Release Notes
  1. Unity Version Control (previously Plastic SCM)

Smart Locks

Use smart locks to manage file access in Unity Version Control.
阅读时间4 分钟
最后更新于 8 个月前

You can use Smart Locks, also known as exclusive check outs, in Unity Version Control (UVCS) to help you collaborate on projects. When you check out a file, you can lock it to prevent anyone else from modifying the file to avoid conflicts. For example, you can lock non-mergeable assets, such as 3D models, images, or audio files.
For more information, refer to Use Smart Locks.

Smart Lock behavior

When you check out a file you have two options: Checkout or Lock and checkout. If a file has existing lock rules, then the normal check out locks the file according to those rules regardless. If there are no existing lock rules and you select Lock and checkout, then UVCS prompts you to create a new lock rule for that context.
A locked file displays a lock icon to indicate that it’s locked. If you try to check out a locked file, a dialog informs you that the file is locked. You can't check out, check in, or merge any files that are locked by another user; whoever has the file locked is the only person who can update it. This prevents multiple users from changing the same file in parallel and ensures that only the latest revision is modified.
To avoid any loss of work, Smart Locks keep track of your repository to ensure that only the latest revision of a file can be locked. This lets you know if the latest revision of a file is on another branch and prevents you from checking out an outdated revision.

Lock rules

The following types of lock rule are available:
  • An organization rule: these rules apply to all repositories that don’t have repository specific rules. You can only create one rule per organization.
  • A repository specific rule: these rules are specific to a repository and overwrite the organization lock rules. You can create multiple repository specific rules.
For more information, refer to Create lock rules.

Retained locks

When you check in a locked file on a branch that isn't the destination branch, the file status is set to
Retained
. To unlock the file, you need to merge the change to the destination branch.
If you try to check out a file with a retained lock, Unity Version Control informs you that there is a newer version of the file on another branch. Since retained locks are not held by the specific user who created the lock, any user can check out the latest revision of a file with a retained status.​ To remove the retained status, you can either check out the file from that branch and merge it to the destination branch, or you can contact the lock owner or an admin to remove the lock.

Destination branch

The destination branch is the source of truth when creating a new lock. The default destination branch is
/main
. If no current revision has the retained status, the revision loaded in the destination branch is considered the latest revision.
You can also set multiple destination branches so that you can lock the same files on different branches at the same time. For example, if the different or unrelated branches need to diverge or specialize:
  • You can set multiple destination branches, so that when you check out a file,the system only checks for the latest revision within the destination branch scope.
  • This setup ensures that any changes to specialized files remain isolated to their respective branch and doesn’t interrupt the locks and workflows on the other destination branch(es).

Smart Locks workflow

Create the Lock

First, you check out the file and create a lock from the latest revision of a file. The latest revision is either the version in the destination branch or a version with a retained status.
If you don’t make the lock from the latest revision of the file, the checkout operation fails and UVCS displays a message to inform you.

Remove the lock

When you complete your changes, either check in the file or merge the changes to the destination branch to release the lock.
If the file was exclusively checked out in a different branch, when you check in the file the lock transitions from Locked to Retained status. You must then merge to the destination branch to remove the lock. While in the
Retained
status, any user can check out the file and make new changes, as this is now considered the latest revision.
Alternatively, lock owners or admins can manually release or remove the lock.

Technical considerations

  • Smart locks don't travel across replica repositories. A replica might have newer revisions to the repository and leave your lock outdated.
  • A deleted changeset can cause an outdated lock.
  • The merge-to function doesn't support locks.
  • Lock rules don't support the
    lockserver
    field.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • Smart Lock behavior

    • Lock rules

    • Retained locks

    • Destination branch

    • Smart Locks workflow

      • Create the Lock

      • Remove the lock

    • Technical considerations


报告此页面的问题