I need to exclude the deleted file in git log. I use the command git log -1 --name-only --pretty=format:eee6ce6
to get the changed file name in last that commit. I using pre-receive hook to block the specific file type committing. Above command listed all file which has modified.
But I wanna allow the user to remove the specific file types. How can I do this?
git log -1 --name-only --pretty=format:eee6ce6-filter=d
command too, But it also listing the deleted file.git log -1 --diff-filter=d --name-only
perfectly works. But the it giving commit ID, author name, date
also. I want only the file name.You can get the names of deleted files in the last commit using git diff
:
git diff --name-only --diff-filter=D HEAD~1