How do you list all commits that touched a path, including deleted files?
IntermediateConceptCommits, branches and tags
Answer
Use git log -- <path>; the double dash disambiguates paths from refs and works for deleted paths. Add --follow for a single file across renames, and --diff-filter=D to find deletion commits.
git log --oneline --diff-filter=D -- old/module.py
git log --follow -p -- src/helpers.py
More on Commits, branches and tags
How do you write a good commit message?BeginnerWhat is the difference between `git add .`, `git add -A` and `git add -u`?BeginnerHow do you commit only part of the changes in a file?BeginnerHow do you change the last commit message or add a forgotten file?BeginnerWhat is the difference between `git switch`, `git restore` and `git checkout`?BeginnerWhat is the difference between lightweight and annotated tags?Beginner