Worktree/session creation should fetch latest `origin/master` before branching
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 2.1k
- Fork
- 153
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### 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_
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia individuando il flusso di creazione di session/worktree e la logica che parte dalla ref locale origin/default-branch. Traccia come l’app invoca Git prima della creazione del branch, quindi aggiungi la copertura dei test per una ref di remote-tracking obsoleta; il lavoro è completato quando i nuovi worktree si basano sulla default branch recuperata più di recente oppure viene mostrato l’avviso documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git
- Ambito
- desktop, developer-experience
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100