I just created a local commit, and I would like to see all the changes that were made in that local commit, so I would like to diff it against what it was prior to that commit. Do I just git log to find the IDs of the last commits, and then git diff last_commit_id prior_to_last_commit_id, or is there a better approach?
In addition, when I tried this command, it brought up some kind of terminal interactive tool where I have to press the down arrow to see the changes in a file. Is there a way to show this in an editor instead of in the terminal?
git diff HEAD~1 > file.patchthen open the file? But I'd recommend knowing what's going into the commit before making it, using e.g.git add -pto review piece by piece and choosing what to stage.git log -p, perhaps with--no-walkor-n 1or-1; andgit show. Thegit showcommand is roughly equivalent togit log -p --no-walk(with the key difference being their behavior on merge commits).