git --no-pager log -1 --pretty=%h <filepath>