Posted about 8 years ago. Visible to the public.

Git: How to show only filenames for a diff

When you want to do a git diff but do not care about the full diff and just want to know which files changed, use the --name-only switch:

Copy
$ git diff --name-only app/controllers/sessions_controller.rb app/models/user.rb features/sign_in.feature

To include some brief information about changed lines, use the --stat switch:

Copy
$ git diff --stat app/controllers/sessions_controller.rb | 8 +- app/models/user.rb | 30 ++++ features/sign_in.feature | 136 +++++++++++++++++

The output of --stat is nicely colored. If you want a more machine-readable output, use the --numstat switch:

Copy
$ git diff --numstat 4 4 app/controllers/sessions_controller.rb 18 12 app/models/user.rb 123 13 features/sign_in.feature

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Owner of this card:

Avatar
Arne Hartherz
Last edit:
over 4 years ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more