0

I am currently using this Git command to show all modified files

git log --name-status -1 --oneline     

What can I add to this command to show added and deleted files?

George Murphy
  • 937
  • 2
  • 10
  • 16
  • maybe duplicate? of this link:[StackOverflowLink](https://stackoverflow.com/questions/15271435/list-all-changed-files-with-change-status-between-git-commits-added-modified) – smitty_werbenjagermanjensen Aug 24 '18 at 11:19
  • Not really a duplicate. I love this code because I do not have to go looking for the sha hash `git log --name-status -1 --oneline` Is there any way I can run this command without the sha hash? `git diff --name-status SHA1 SHA2` – George Murphy Aug 24 '18 at 11:40
  • Maybe you can look into the --diff-filter command I'm not entirely sure to be honest with you? I usually use the SHA command or something like it. Maybe you can try a command like this?? git diff --name-only HEAD~20 HEAD~10 (you can use this command to see the difference between the 20th commit and 10th commit). Sorry, I'm not of more help. – smitty_werbenjagermanjensen Aug 25 '18 at 12:44

1 Answers1

0

What can I add to this command to show added and deleted files?

I'm not sure I understand the gap here. I ran your command as-is on a test repo.

$ git log --name-status -1 --oneline
7517b16 3
M       file2
D       file3
A       file4

file2 was modified (so line starts with M). The line starting with D shows that file3 was deleted. The line starting with A shows that file4 was added.

Mark Adelsberger
  • 42,148
  • 4
  • 35
  • 52