The git log command can be used to view the history of commits. In this example, every commit of foo.txt will be displayed.
git log foo.txt
The log will display entries like this.
commit mks910122020slsmm3lsosos020399489sl
Author: John Doe <john.doe@example.com>
Date: Wed May 31 14:51:14 2020 -0500
Third commitment
commit dkci85474fjfdkd9393934k49f9fk002kd01
Author: John Doe <john.doe@example.com>
Date: Tue May 30 18:23:36 2020 -0500
Second commitment
commit fj83m3ld0d0d3m3ld0389303l3ld0d0d39dl
Author: John Doe <john.doe@example.com>
Date: Mon May 29 20:26:09 2020 -0500
First commitment
Sometimes, it's a tad easier to work witht the --oneline flag.
git log --oneline
Which will produce output like this:
bk19sl1 Third commit
8jfj20d Second commit
afba75a First commit
Or even better, you can fine tune the output.
git log --pretty=format:%h,%cn,%cd,%s --date=local
Which will produce output like this:
bk19sl1,John Doe,Wed May 31 14:51:14 2020,Third commit
8jfj20d,John Doe,Tue May 30 18:23:36 2020,Second commit
afba75a,John Doe,Mon May 29 20:26:09 2020,First commit