Skip to content
Discussion options

You must be logged in to vote

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 --relative

If you want to keep this ergonomic, an alias also works well:

git config alias.cdxdiff 'diff --relative'

Then in Codex:

!git cdxdiff

If 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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tom-huntington
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants