Is there any approach to diff the current work directory with a specific commit and view all changed files? #4478
Unanswered
rijuyuezhu
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This is not an answer, but I'd be curious why you want to diff the working copy against a commit. What's the concrete use case? I'm asking because I can't remember ever having had that requirement myself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! A feature that I eagerly want in lazygit is to compare a commit with the current work directory, typically achieved in git by simply
As far as I know, lazygit supports such usage by first selecting the
<commit-id>
, then<C-W>
to enter the diff mode. And now the[2] Files - Worktrees - Submodules
area shows a partial list of files, and moving on them shows the diff. However, the listed files are essentially those also changed compared with HEAD, but not all of the files that change compared with<commit-id>
.I found a workaround for such problem: first move on
<commit-id>
, then<C-W>
and select "Enter ref to diff". After that I enter an insignificant flag such as--color
. Then the diff command becomesgit diff --stat -p --color <commit-id> --
, and now I can directly<Enter>
on<commit-id>
and the diff of all files shows there.Is there any more elegant method to achieve the same effect? Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions