github / github/app

Warn when selected folder resolves to a parent Git repository root

オープン
#719 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Requests and ideas
主要言語
言語のデータがありません
スター
2.1k
フォーク
153
PR マージ指標
30日以内にマージされた PR はありません

説明

### Feature summary

Warn users when a selected subfolder resolves to an (accidentally) initialized parent Git repo, causing Copilot to open the parent directory instead.

### What problem are you trying to solve?

When a user selects an empty or new folder that lives inside an existing Git repository, Copilot opens the parent repository root instead of the selected folder. This follows normal Git behavior, since the selected folder inherits the nearest parent `.git` directory, but the UX is surprising when the user does not realize the parent directory is a repository.

Example:
- User selects: `~/personal-projects/new-empty-folder`
- Parent repo exists at: `~/personal-projects/.git`
- Copilot opens session at: `~/personal-projects`

This can look like Copilot ignored the user’s folder selection. Honestly, this problem really only occurs if the user _forgets_ that the parent directory (`personal-projects`) was originally set up as a git repository...

### Proposed solution

When the selected folder resolves to a parent Git repository root that is different from the selected path, Copilot should explicitly acknowledge this before creating the session.

Suggested message:
> The folder you selected is inside an existing Git repository:
>
> Selected folder: `~/personal-projects/new-empty-folder`
> Repository root: `~/personal-projects`
>
> Copilot sessions are created at the repository root, so this session will open `~/personal-projects` instead.

### Workflow impact

This is especially confusing for common personal dev workflows where users keep many unrelated projects under a container directory like `~/personal-projects`, `~/code`, or `~/src`. If that container directory was _accidentally_ initialized as a Git repo, every new empty child folder appears to Copilot as part of the parent repo.

### Installation context

_No response_

### Additional context

_No response_

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

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

評価

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

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

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