Skip to content

task-observer: docs/ai/git updates from 2026-05-08#12

Open
divad12 wants to merge 1 commit into
masterfrom
task-observer/git-2026-05-08
Open

task-observer: docs/ai/git updates from 2026-05-08#12
divad12 wants to merge 1 commit into
masterfrom
task-observer/git-2026-05-08

Conversation

@divad12
Copy link
Copy Markdown
Owner

@divad12 divad12 commented May 8, 2026

Target

global-doc: docs/ai/git.md

Observations addressed

  • Observation 12 (journology/log.md): Reuse existing clean worktrees before creating another → changed: added "Worktree Recovery" section to docs/ai/git.md describing how to check for and reuse a clean existing worktree before creating a new one when recovering from accidental main-checkout edits

Generated by Claude Code

Before creating a new worktree to recover from accidental main-checkout
work, check whether a clean existing worktree can be reused instead.
Minimises workspace sprawl and abandoned branches.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dd72d6a66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ai/git.md
Comment on lines +74 to +75
git -C <worktree-path> fetch origin <target>
git -C <worktree-path> checkout <target>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fast-forward the branch before recovery

Step 2 says to “Fast-forward” the existing worktree branch, but the documented commands do not do that: git fetch origin <target> only updates fetched refs/FETCH_HEAD, and git checkout <target> just switches HEAD to a branch (git checkout -h: usage: git checkout [<options>] <branch>). In a common case where local <target> is behind origin/<target>, this leaves the worktree on a stale tip and can cause cherry-picks to be replayed onto the wrong base.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants