工作树中的差异文件与远程跟踪分支中的文件

diff file in worktree with file in the remote tracking branch

我有这个命令:

git diff -w remotes/origin/dev:"$file" HEAD:"$file"

我想知道如何将它与工作树而不是 HEAD 进行比较,如下所示:

git diff -w remotes/origin/dev:"$file" WORKTREE:"$file"

也许方法就是这样?

git diff -w remotes/origin/dev:"$file" "$file"

有人知道吗?

这应该可以做到这一点:

git diff -w remotes/origin/dev:"$file" "$file"