文档

​
​

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
  • Tutorials
    • Migrate from Git
    • Migrate from Perforce
    • Version Control settings
    • Configure the client
    • Version Control workflow
    • Version Control tools
      • Enable dynamic workspaces (Windows)
      • Create a label
      • Create an attribute
      • Create a mergebot
      • Use Smart Locks
      • Use Xlinks
      • Use Unity Samples
      • Use triggers
      • Transfer project to a different organization
  • On-Prem
  • Gluon
  • CLI and shortcut references
  • Release Notes
  1. Unity Version Control (previously Plastic SCM)

Use Smart Locks

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

Use Smart Locks to avoid merge conflicts and simplify the version control process for non-mergeable files.

Create lock rules

You can create lock rules in the Unity Dashboard, under the Version Control Settings menu. Items are under the lock rule if their file extension matches any of the extensions set up in the rule.

Lock a file

To lock a file:
  1. In any UVCS client that supports checkouts, select a file in the workspace explorer.
  2. Right-click and select Lock and Check Out.
  3. In the UI, the locked file indicates a lock icon and the Status updates to Locked.
If a file has existing lock rules, these rules apply even if you select Checkout.
注意
If there are no matching lock rules create a new one using the dialog. You must have permission to create lock rules; otherwise, ask your admin.

Access a locked file

If you try to check out a locked file, the UI displays an error message which shows that the file is locked and who has locked the file.
Smart Locks also prevent you from checking out a revision that's not the latest. An error message informs you if you try to check out an older revision.
You should wait until the lock is released, or you can contact the lock owner or an admin to release or remove the lock.

Release a locked file

Releasing a lock makes the file available to someone else to make changes in the latest revision. This sets the status to Retained, meaning it's the latest edit of a development line that started in your Destination branch.
To release a locked file, check-in your change:
  1. If the change is in a different branch than the Destination branch the file status is set to Retained.
  2. If the change is in the configured Destination branch the lock is removed completely.
注意
Lock owners can manually release locks by following these steps:
  1. In the Unity Dashboard, go to Development > Products.
  2. Select DevOps.
  3. Open your repository, and navigate to the File locks tab.
  4. Search for your locked file and select the Release button to release the lock.
This is only recommended as a last resort as it could enable merge conflicts.

Remove a lock

Removing a lock means that your development is complete and the file has no current lock status. From this point, the last revision is considered to be the one in your Destination branch.
To remove a lock:
  1. If the change is in a different branch than the Destination branch, merge your changes to the Destination branch.
  2. If the change is in the configured Destination branch, check-in your changes to completely remove the lock.
The latest version of the file is now available in the repository for other users to check out.
注意
Lock owners or admins can manually remove locks by following these steps:
  1. In the Unity Dashboard, go to Development > Products.
  2. Select DevOps.
  3. Open your repository. Now you have two options to search for your locked file and remove the lock: a. From the File Explorer tab, search for your locked file and select the Remove lock action. b. From the File locks tab, search for your locked file and select the Remove lock action.
This is only recommended as a last resort as it could enable merge conflicts.

View existing locks

To view the locked files in the UVCS Desktop Client:
  1. Open Workspace Explorer.
  2. Select Show locks.
To view the locked files in the Unity Dashboard:
  1. Open a Repository.
  2. Open the File Locks tab.

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

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

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

  • 在本页上
    • Create lock rules

    • Lock a file

    • Access a locked file

    • Release a locked file

    • Remove a lock

    • View existing locks


报告此页面的问题