Skip to content
WorktreeWise
Git Worktree CommandStep #6

git worktree unlock: Unlock a Git Worktree

The git worktree unlock command removes the protective lock flag from a linked worktree, enabling it to be moved, removed, or cleaned up by administrative pruning.

Basic Syntax

Terminal
# Unlock a worktree by relative path or directory name
$git worktree unlock <worktree>

Example:

Terminal
# Removes the lock on perf-benchmarks
$git worktree unlock ../perf-benchmarks
📁
Normal Worktree

Pruneable if directory is temporarily unreachable

git worktree lock →← git worktree unlock
🔒
Locked Worktree

Safe on external SSDs, USB drives, or persistent build caches

What Changes When You Unlock a Worktree?

When a worktree is unlocked:

Verifying Worktree State

Inspect git worktree list to confirm the lock annotation has been removed:

git worktree list (now unlocked)
/home/developer/projects/my-app          9a8b7c6 [main]
/home/developer/projects/perf-benchmarks 1d2e3f4 [perf/bench]
WorktreeWise

Unlock Worktree

Try Free

In WorktreeWise, unlocking is as simple as clicking the padlock icon. The app displays real-time lock indicators and protects your critical worktrees with visual confirmation modals.

Unlock action for a protected Git worktree in WorktreeWise

Related commands

After unlocking, you can safely remove the temporary directory using git worktree remove or prune obsolete records with git worktree prune.