Pick a nested git repo when the project root isn't a git repo #13644
scriptease
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
If a project's root directory is not a git repository, the git actions control shows only one option: Initialize Git. That runs
git initat the project root.That's wrong for two common layouts:
~/github/containingrepo-a/,repo-b/,repo-c/, each with its own.git. You add the parent folder as the project so the agent can read and change several repos in one thread.In both cases, initializing git at the root is not what you want. It would create a repo that contains other repos. Once you skip it, you lose the diff view, commit, push/PR actions, and checkpoints, even though the files the agent is editing are already inside a real git repo.
Proposal
When the project root is not a git repo, offer a Select repository option next to Initialize Git:
.git(a directory, or a file for worktrees/submodules). Limit the depth, for example 2 or 3 levels, and skipnode_modulesand the like.repo-a,packages/api, ...).Heuristic default (optional)
People often open the first message with the folder they want to work in ("in
repo-b, fix ..."), and agents tend to stay in one repo per turn. Two signals could preselect a repo:This should suggest a repo, not silently switch to it. The user confirms, or it shows as the default that they can change.
Open questions
Why
Pointing the agent at a parent folder is the easiest way to work across related repos (a shared lib plus its consumer, frontend plus backend in separate repos). Today that setup costs you every git feature in T3 Code, or you have to create a pointless root repo.
All reactions