github / github/app

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

Đang mở
#2,278 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Bugs
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
153
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git
Lĩnh vực
desktop, developer-experience
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.