# List changed in the last commit git diff-tree --no-commit-id --name-only -r $(git rev-list HEAD^..HEAD) # Python version [patch.new_file_path for patch in repo.diff('HEAD', 'HEAD~1'))]