github / github/app

Worktree/session creation should fetch latest `origin/master` before branching

Offen
#2,278 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Bugs
Vorherrschende Sprache
Keine Sprachdaten
Sterne
2.1k
Forks
153
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Short summary

_No response_

### Affected version or release

_No response_

### Installation context

_No response_

### What happened?

When creating a new session/worktree, the app branches from the local `origin/master` remote-tracking ref without first running `git fetch`. If the main checkout hasn't fetched recently, new sessions silently start from a stale snapshot of master instead of the true latest remote commit.

**Proposed solution:**

Run `git fetch origin ` before creating the new branch/worktree, so every new session reliably starts from the actual latest commit on the remote default branch. At minimum, surface a warning if the local `origin/` ref is behind the real remote.

**Workflow impact:**

Affects anyone using the app for parallel/worktree-based sessions. Can lead to merge conflicts or duplicated work discovered only by manually diffing against remote — as happened to me just now (branch was created 1 commit behind actual origin/master).

## **Additional context:**

Confirmed via `git reflog show ` → "Created from origin/master", while `git status -sb` on the main checkout showed "behind 1" vs the real remote at creation time.

### Steps to reproduce

_No response_

### Expected behavior

_No response_

### Additional context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by locating the session/worktree creation flow and the logic that branches from the local origin/default-branch ref. Trace how the app invokes Git before branch creation, then add coverage for a stale remote-tracking ref; done means new worktrees are based on the latest fetched default branch or the documented warning is surfaced.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git
Bereich
desktop, developer-experience
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.