Zend certified PHP/Magento developer

How to display all of the git objects of a working tree file?

The closest I got is this unrelated answer.

For example, the working tree have the foobar.txt file (which is committed as well). This file contains the foo text at line 1 and bar at line 2. These two lines have two git objects (a object whose content is foo and another with bar). How to, from foobar.txt, get these two objects id?

The idea here is to get the git objects that formed the current foobar.txt file.

And, if possible, how to display these objects’ id in the same order from foobar.txt‘s lines?