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 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. From the Unity Cloud Dashboard, open DevOps.
  2. Open your repository, and navigate to the File locks tab.
  3. 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. From the Unity Cloud Dashboard, open DevOps.
  2. 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 Cloud Dashboard:

  1. Open a Repository.
  2. Open the File Locks tab.