Search code examples
gitgit-worktree

diff file in worktree with file in the remote tracking branch


I have this command:

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

I am wondering how to diff it with the worktree instead of HEAD, like this:

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

maybe the way to do it is just like this?

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

anyone know?


Solution

  • This should do this trick:

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