Suppose we change several files, and want to view the diff for one at a time, I know we can use something like this
git status
Changes not staged for commit:
directory)
modified: app/assets/stylesheets/application.scss
modified: app/javascript/packs/application.js
modified: app/views/layouts/application.html.erb
modified: config/webpack/environment.js
and run
git diff app/assets/stylesheets/application.scss
then
git diff app/javascript/packs/application.js
and so on..
git diff app/views/layouts/application.html.erb
To view each of the files' diffs one by one (one by one is desired here, but all the typing of file paths isn't, even with tab to auto complete).
Question
Is there a way to achieve the same (i.e. view git diff for a single file at a time) but without having to type (manually, nor with tab autocomplete) the full path to the changed file? (e.g. can we reference somehow, pseudo-code: git diff --mod_file 1, git diff --mod_file 2 etc) ?