Issue using sls deploy inside of worktrees
Author: jamesclancyCreated Sep 15, 2026Updated Sep 15, 2026
Issue description
We are having issues running sls deploy --verbose --force --stage {stage} -c serverless.{service_name}.yml from inside of worktrees.
Previously this worked with 4.41 but it seems with 4.42 it now returns s:cli-error-handler: Error: ENOTDIR: not a directory, stat '{worktree_path}/.git/**'
It appears that the cli is now checking the .git and is assuming it is a directory. For worktrees this is a file.
Context
No response
Source: serverless/serverless