Warning

The product is in closed beta and not open to the public.

lock

vb lock [PATH...] [OPTIONS]

Description

Lock files to obtain exclusive access.

Existing locks held by the current user are retained and reported as SKIP.

With lock-auto setting enabled:

  • add automatically locks newly added files.

  • commit checks locks and auto-unlocks after commit.

Commands with –lock and –unlock:

The options apply to all files affected by the command: –lock acquires locks before it runs and –unlock releases them afterwards. With lock-auto enabled, paths that stop being tracked are also unlocked automatically.

Options

-s, --skip-conflict

Skip files that conflict with this operation

-g, --global

Lock the global branch

-m, --comment TEXT

Add a descriptive comment (quote multi-word text)

-n, --dry-run

Show what would be locked without making changes

-t, --time DURATION

Set lock duration (ISO 8601 format), e.g.: PnYnMnDTnHnMnS or simplified forms like P1D, PT2H30M

-v, --verbose

List files when the operation conflicts

Reference

ISO 8601 durations: https://en.wikipedia.org/wiki/ISO_8601#Durations

Examples

  • Lock a file on the current branch:

    $ vb lock Content/Hero.uasset
    LOCK trunk Content/Hero.uasset
    
  • Lock multiple files:

    $ vb lock Config/DefaultGame.ini Content/Maps/Start.umap
    LOCK trunk Config/DefaultGame.ini
    LOCK trunk Content/Maps/Start.umap
    
  • Lock all tracked files in a directory:

    $ vb lock Content/Characters
    LOCK trunk Content/Characters/Hero.uasset
    LOCK trunk Content/Characters/Hero_Skeleton.uasset
    
  • Add a comment and set the lock duration:

    $ vb lock Content/Maps/Start.umap --comment "Updating the startup map" --time PT2H
    LOCK trunk Content/Maps/Start.umap
    
  • Lock a file globally:

    $ vb lock Content/Maps/Start.umap --global --time P1D
    LOCK G Content/Maps/Start.umap
    
  • Skip files that are already locked by another user:

    $ vb lock Content/Maps/Start.umap Config/DefaultGame.ini --skip-conflict
    LOCK trunk Config/DefaultGame.ini
    
  • Lock a file already held by the current user:

    $ vb lock Content/Hero.uasset
    LOCK trunk Content/Hero.uasset
    $ vb lock Content/Hero.uasset
    SKIP trunk Content/Hero.uasset
    
  • Show detailed conflict information:

    $ vb lock Content/Maps/Start.umap --verbose
    lock: 1 file already locked
      alice locked 1 file on trunk, expires 2026-10-16 10:30:00
        comment: Updating the startup map
        files:
          Content/Maps/Start.umap
    
  • Enable automatic lock integration for this checkout:

    $ vb settings lock-auto on
    

    With lock-auto enabled, add locks newly added files. commit checks its file set for locks held by other users and unlocks submitted files after a successful commit.

  • Override automatic add and commit locking when needed:

    $ vb add --no-lock Content/Prototype.uasset
    ADDED  Content/Prototype.uasset
    $ vb commit --keep-lock -m "Keep editing prototype" Content/Prototype.uasset
    
  • Lock or unlock the complete file set of a stash operation:

    $ vb stash save --lock -m "Temporary Hero update" Content/Hero.uasset
    REVERT   Content/Hero.uasset
    stash 1 saved
    $ vb stash pop --unlock
    

    The --lock and --unlock options are also available on addremove, delete, revert, stash, undo, and redo. --lock obtains locks before the operation; --unlock releases them afterward. When lock-auto is enabled, removing a file from version control also releases its lock automatically.

See Also