If you want to see a history of commits you must use the following command:
$git log
The history will show the Commit Identification Number, Author, Date, and the commit message that was entered by the developer.
commit f78250ca8f938a6a427e37b6b8aedc8cc1a59c22 Author: David Loo Date: Sun Sep 16 21:21:50 2012 +0800 hello commit dbf4aa15c50ccaec3a075399e336c0c49934122a Author: David Loo Date: Sun Sep 16 21:20:51 2012 +0800 Hello commit a204716d55aad334e5fc669fa1f9d611012461cb Author: David Loo Date: Sun Sep 16 21:00:11 2012 +0800 Insertion commit 2aaa14f6d89d75156db8f9a08a903ad83d471f92 Author: David Loo Date: Sun Sep 16 20:57:12 2012 +0800
If you want to view the individual commits that are listed above you can use the show command followed by the commit identification number:
$git show 2aaa14f6d89d75156db8f9a08a903ad83d471f92
Below you can see the extended details of specified commit id. The details shows the author, date, commit message and the change that was made to this file.
commit 2aaa14f6d89d75156db8f9a08a903ad83d471f92 Author: David Loo Date: Sun Sep 16 20:57:12 2012 +0800 made a change in file diff --git a/index.html b/index.html index 3fa0d4b..8570763 100644 --- a/index.html +++ b/index.html @@ -1 +1,2 @@ Hello, World +This is a change
Above where the text says ‘This is a change’, this was the text inserted to the index.html file before the commit and you will see the + plus sign next to the text which means that this line was inserted or added.
Reference: