Use Smart Locks

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 Cloud 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 Unity VCS 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 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 and remove a lock from a 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.

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. ​

Release a locked file

To release a locked file: ​

  1. Checkin your change.
    1. If the change is in a different branch than your Destination branch the file status is set to Retained.
    2. If the change is in the configured Destination branch the lock is removed completely. ​

Remove a lock

To remove a lock:

  1. Merge your changes to your Destination branch, or if you are already working in the Destination branch, just check in.
  2. The latest version of the file is now available in the repo for other users to check out. ​

Lock owners or admin users can both release and remove a lock status manually. This is only recommended as a last resort as it could enable merge conflicts. ​

View existing locks

To view the locked files in the Unity VCS Desktop Client:

  1. Open Workspace Explorer.
  2. Select Show locks.

To view the locked files in the Unity Cloud Dashboard:

  1. Open a Repository.
  2. Select File Locks.