Skip to content

Add --worktree option to control original repo bind mounting#22

Merged
yarikoptic merged 2 commits intoenh-worktreefrom
copilot/sub-pr-19
Dec 7, 2025
Merged

Add --worktree option to control original repo bind mounting#22
yarikoptic merged 2 commits intoenh-worktreefrom
copilot/sub-pr-19

Conversation

Copy link
Contributor

Copilot AI commented Dec 6, 2025

Addresses security concerns about automatic bind mounting when running in git worktrees by making the behavior explicit and user-controlled.

Changes

  • Added --worktree option with four modes:

    • ask (default): Prompts user with security warning before bind mounting
    • bind: Automatically bind mounts original repo
    • ok: Runs without bind mount
    • error: Exits if worktree detected
  • Updated documentation with usage examples and security implications

Usage

# Prompt before mounting (default)
yolo

# Always bind mount
yolo --worktree=bind

# Never bind mount
yolo --worktree=ok

# Disallow worktrees
yolo --worktree=error

The ask prompt informs users that bind mounting enables git operations but may expose unintended files, addressing the silent exposure concern.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance bind mount original repo in git worktree Add --worktree option to control original repo bind mounting Dec 6, 2025
Copilot AI requested a review from yarikoptic December 6, 2025 16:24
@yarikoptic yarikoptic marked this pull request as ready for review December 7, 2025 12:55
@yarikoptic yarikoptic merged commit 7909ca2 into enh-worktree Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants