Skip to content

feat: support local git repositories without a remote#896

Merged
natllian merged 5 commits into
mainfrom
nathan/git-worktree-research-plan
Jun 24, 2026
Merged

feat: support local git repositories without a remote#896
natllian merged 5 commits into
mainfrom
nathan/git-worktree-research-plan

Conversation

@natllian

@natllian natllian commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

closes #873
closes #290
closes #841

Summary

Adds first-class support for local git repositories that have no remote. Previously Helmor rejected any git repo without a remote (“Local-only repositories are not supported”). Now such repos work as full git workspaces — in both Local and Worktree modes — with the remote-only features (push, pull, fetch, pull requests, forge connect) cleanly hidden.

What changed

Backend

  • Accept no-remote git repos: the default branch is read from local HEAD (falling back to the first local branch for a detached/unborn HEAD); remote / remote_url / forge_provider stay None.
  • Worktree creation forks from a local branch when there is no remote (finalize already fell back to local refs; phase-1 no longer hard-requires a remote).
  • Unified remote handling: a single git_ops::remote_name() is now the source of truth for “has a remote”, replacing ~19 scattered unwrap_or("origin") sites that faked an origin. Restore is best-effort on the remote (and works without one).

Frontend

  • Remote-only actions (Create PR / Push / Merge / Connect / sync) are hidden for local-only repos.
  • Repo settings is three-state — normal (git + remote), local-only (git, no remote), and non-git — showing a “Local-only repository” notice, a local-branch picker, and only the applicable preferences.
  • The start page works unchanged (it is a git repo); the branch picker lists local branches.

Tests

  • Rust: accept-no-remote-repo, no-remote worktree create+finalize (forks from local branch), updated target-resolution + fixtures. cargo clippy -D warnings and the full cargo test suite pass.
  • Frontend: local-only repo-settings panel test; full suite (1643) + typecheck pass.

A minor changeset and an in-app announcement are included.

natllian added 3 commits June 24, 2026 17:56
Accept git repos that have no remote (local-only), including worktree
workspaces. Branches, diffs, commits, and worktrees all work; the default
branch comes from local HEAD.

- Unify remote handling: add `git_ops::remote_name()` as the single source
  of truth and remove all `unwrap_or("origin")` debt; restore is now
  best-effort on the remote (and works without one).
- Repo creation no longer rejects no-remote git repos; forge_provider stays
  None when there's no remote.
- Worktree creation forks from a local branch when there's no remote.
- Gate push / pull / fetch / PR / Connect UI for local-only repos; repo
  settings becomes three-state (normal / no-remote / non-git) with a
  local-branch picker and a "Local-only repository" notice.
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
helmor-marketing Ignored Ignored Preview Jun 24, 2026 7:42pm

Request Review

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 24, 2026
@dosubot

dosubot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

📄 Knowledge review

✏️ Suggested updates

2 page suggestions need review.

Page Library Status
01 - Repository Helmor 🟡 Review
03 - Add a Repository Helmor 🟡 Review
📝 01 - Repository
@@ -15,10 +15,11 @@
 
 | Mode | What you get |
 |------|-------------|
-| **Local only** | File browsing, workspace creation, agent sessions, local commits. |
+| **Non-git folder** | File browsing only. No git history, branches, or commits. |
+| **Local git repository (no remote)** | Git operations (branches, diffs, worktrees, commits) available. Push/pull/PR features hidden. |
 | **GitHub-connected** | Everything above, plus remote branch tracking, account identity, and pull request workflows. |
 
-A local repository is sufficient for isolated agent work and review. Connect GitHub when you need remote collaboration, branch protection context, or PR-based shipping.
+A local git repository is sufficient for isolated agent work and review. Connect GitHub when you need remote collaboration, branch protection context, or PR-based shipping.
 
 ## Adding a repository
 

Accept · Edit · Decline

📝 03 - Add a Repository
@@ -9,6 +9,8 @@
 3. Confirm the detected default branch (e.g., `main` or `master`).
 
 The repository appears in your sidebar immediately. Helmor reads the Git history, branches, and file tree from disk.
+
+> **Note:** Git repositories without a remote are fully supported. Basic Git operations — branches, diffs, worktrees, and commits — all work locally. Push, pull, and pull request features are only available when a remote is configured.
 
 ## Add a GitHub repository
 
@@ -23,7 +25,7 @@
 - **Workspaces** — isolated copies branched from your default or target branch.
 - **File browsing** — view, search, and navigate the project tree.
 - **Diffs** — compare agent changes against the base branch.
-- **Git operations** — commit, push, and prepare PRs from inside the app.
+- **Git operations** — commit locally, create branches, and manage worktrees; push and PRs require a configured remote.
 
 Helmor does not replace Git. It wraps Git with an agent-friendly workflow layer.
 
@@ -31,6 +33,6 @@
 
 - Add repositories you are comfortable reviewing through Helmor.
 - Use one workspace per task — avoid long-lived "catch-all" workspaces with unrelated changes.
-- For team projects, connect GitHub so workspaces can target the correct remote branch and shipping path.
+- Connect GitHub for team projects to enable push, pull, and pull request workflows targeting the correct remote branch.
 
 **Next:** [Create a Workspace](https://app.dosu.dev/9207e853-a462-496b-ac67-bc8e8fde3782/documents/d9f9b034-8c2d-4974-b0b8-af9b3e56e377) to start your first task.

Accept · Edit · Decline


Leave Feedback Ask Dosu about helmor

@natllian natllian changed the title chore: simplify git-no-remote announcement text feat: support local git repositories without a remote Jun 24, 2026
natllian added 2 commits June 25, 2026 03:18
A git repo with no remote was still showing remote-only UI that makes no
sense without a remote:

- The inspector "Actions → Git" section dropped the push-status row
  ("Branch fully pushed" / "Branch not published"); only uncommitted and
  sync (shown as "unavailable") remain.
- The workspace header no longer renders the `→ target branch` picker or
  the stacked-PR chip — it shows just the current branch name.
- Inspector "uncommitted changes" action commits locally only when the repo
  has no remote. It was hardcoded to commit-and-push, so the dispatched
  prompt told the agent to `git push -u origin HEAD` — which always failed
  on a remoteless repo (and the header commit button is hidden there, so
  this was the only commit entry). The prompt now skips push and the row
  reads "Commit" instead of "Commit and push" when there's no remote.
- Changes-section `hasRemote` now keys off the remote name (the repo.remote
  SSOT) instead of remoteUrl, matching header/panel/settings.
- Reword the default-branch resolution error: an empty `git init` repo
  resolves to its unborn branch and is accepted, so the old "empty
  repository" wording was misleading.
@natllian natllian merged commit d172b5b into main Jun 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

1 participant