Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see which files were changed in last commit

Tags:

git

In this commit message, it says that 2 files have been changed.

$ git commit -m "fixed .gitignore" [master c30afbe] fixed .gitignore  Committer: Sahand Zarrinkoub <[email protected]> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly. Run the following command and follow the instructions in your editor to edit your configuration file:      git config --global --edit  After doing this, you may fix the identity used for this commit with:      git commit --amend --reset-author   2 files changed, 5 insertions(+), 4 deletions(-) 

This is a little surprising for me. I thought I'd only staged one file to be changed. Now, I'd like to see which files have been changed and how. What is the way to do this?

like image 757
Sahand Avatar asked Apr 16 '18 08:04

Sahand


People also ask

How do I see file commit history?

Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.


1 Answers

Get all changed files since last commit

git diff --name-only HEAD HEAD~1 
like image 167
Robin He Avatar answered Oct 12 '22 05:10

Robin He