Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unexpected workspaceFolder mount behavior when dev container is opened before Git initialization

オープン
#1,055 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

@v-Kaniska244 がすでに取り組んでいます。

2025年8月6日 から。

評価

この issue はまだ評価されていません。

説明

I've encountered a strange and hard-to-debug behavior when using multiple devcontainer.json files in a monorepo setup.

Steps to Reproduce
  1. Create a new directory (not yet initialized as a Git repository).
  2. Add a .devcontainer folder in the root with multiple devcontainer.json files, each specifying a different workspaceFolder to scope the dev container to a project in the monorepo.
  3. Open one of the devcontainers in VS Code before initializing the root directory as a Git repository.
  4. Observe that the workspace folder is mounted incorrectly — the parent folder is mounted instead of the expected project directory.
  5. Now run git init in the root of the repo.
  6. Reopen the devcontainer. Everything now works as expected, with the workspaceFolder correctly mounted.
🧠 Expected Behavior

The specified workspaceFolder should be mounted correctly, even if the root directory hasn't been initialized as a Git repository.

😕 Actual Behavior

Before Git initialization, the mount behavior is incorrect — it mounts the parent directory instead of the specified workspaceFolder. This is confusing and difficult to diagnose.

💥 Impact

This behavior makes it hard to use dev containers in new projects or automation scripts that generate dev containers before initializing Git. It also leads to unexpected mount paths, which can break tooling, scripts, or assumptions about paths inside the container.

✅ Suggested Fix

The logic determining the workspaceFolder mount should not depend on whether the folder has been initialized as a Git repository. If Git initialization is required for some internal behavior, it should at least produce a warning or fallback gracefully.


Let me know if you'd like logs or a minimal repro repo — happy to provide more detail if needed.

主要言語
TypeScript
スター
3k
フォーク
461
平均マージ
18分
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

devcontainers/cli のほかの issue

devcontainers/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。