Skip to content

How to view commit history in Git?

List all Commit History

Let’s start with Git log command. This will list all commit history.

$ git log


commit 945c03108100904a9c7ba52a83720192bbc4beec
Author: abc abc@gmail.com
Date: Thu Apr 30 17:15:13 2020 +0530
[Bug #3661] Header version updated

commit a8a4456152c7efe49479f41728021e4c33b799d2
Author: abc abc@gmail.com
Date: Thu Apr 30 15:07:17 2020 +0530

[Bug #3706]Bug Fixed

Detailed History on Each Commit

To view the information about the commit in details use --stat flag with git log command.

$ git log --stat

commit a8a4456152c7efe49479f41728021e4c33b799d2
Author: abc abc@gmail.com
Date: Thu Apr 30 15:07:17 2020 +0530
[Bug #3706]Bug- fixed

src/com/user/test.java | 27 +++++++++++++----
1 files changed, 63 insertions(+), 7 deletions(-)

To View Specific Commit Details

If we need to look for specific commit Id details, then make use of git show command. It includes the file name, insertion and deletion of files

$ git show

commit a8a4456152c7efe49479f41728021e4c33b799d2
Author: abc abc@gmail.com
Date: Thu Apr 30 15:07:17 2020 +0530
[JavFn #3706] Bug Fixed

diff --git a/src/com/user/classes/test.java
index e3c1c39..7faf677 100644
+++ b/src/com/user/classes/Test.java
@@ -170,7 +170,48 @@ public class Test {

See also  How to rename an existing git remote ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.