github / github/app

Warn when selected folder resolves to a parent Git repository root

Aperta
#719 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Requests and ideas
Lingua principale
Nessun dato sulla lingua
Stelle
2.1k
Fork
153
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.