The file path in the diff is relative to the repo root, not the current subdirectory. #13291
-
|
I have a monorepo. If I
Any workarounds? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
|
You are hitting a path-base mismatch between the diff output and the current subdirectory context. A reliable pattern is to make Git emit paths relative to your current folder: !git diff --relative
!git diff --cached --relativeIf you want to keep this ergonomic, an alias also works well: git config alias.cdxdiff 'diff --relative'Then in Codex: !git cdxdiffIf you need a custom base, you can also do: !git diff --relative="$(git rev-parse --show-prefix)"That keeps file paths aligned with the folder you are currently working in. |
Beta Was this translation helpful? Give feedback.
You are hitting a path-base mismatch between the diff output and the current subdirectory context.
A reliable pattern is to make Git emit paths relative to your current folder:
If you want to keep this ergonomic, an alias also works well:
git config alias.cdxdiff 'diff --relative'Then in Codex:
!git cdxdiffIf you need a custom base, you can also do:
That keeps file paths aligned with the folder you are currently working in.