github / github/app

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

オープン
#2,278 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
Bugs
主要言語
言語のデータがありません
スター
2.1k
フォーク
153
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
git
領域
desktop, developer-experience
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。