Skip to main content
ubuntuask.com

Back to all posts

How to View the Git Commit History?

Published on
6 min read
How to View the Git Commit History? image

Best Git Tools to Buy in October 2025

1 Learning Git: A Hands-On and Visual Guide to the Basics of Git

Learning Git: A Hands-On and Visual Guide to the Basics of Git

BUY & SAVE
$34.92 $45.99
Save 24%
Learning Git: A Hands-On and Visual Guide to the Basics of Git
2 Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development

Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development

BUY & SAVE
$43.23 $65.99
Save 34%
Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development
3 Professional Git

Professional Git

BUY & SAVE
$24.79 $52.00
Save 52%
Professional Git
4 Version Control with Git: Powerful tools and techniques for collaborative software development

Version Control with Git: Powerful tools and techniques for collaborative software development

  • THOROUGHLY INSPECTED FOR QUALITY-GREAT READS AT A LOWER PRICE!
  • ENVIRONMENTALLY FRIENDLY CHOICE-REUSE AND RECYCLE BOOKS TODAY!
  • AFFORDABLE ACCESS TO DIVERSE TITLES-FIND YOUR NEXT FAVORITE!
BUY & SAVE
$42.44 $44.99
Save 6%
Version Control with Git: Powerful tools and techniques for collaborative software development
5 Head First Git: A Learner's Guide to Understanding Git from the Inside Out

Head First Git: A Learner's Guide to Understanding Git from the Inside Out

BUY & SAVE
$50.99 $79.99
Save 36%
Head First Git: A Learner's Guide to Understanding Git from the Inside Out
6 Git Commands Cheat Sheet Reference Guide – Essential Git Command Quick Guide for Beginners Developers

Git Commands Cheat Sheet Reference Guide – Essential Git Command Quick Guide for Beginners Developers

BUY & SAVE
$14.99
Git Commands Cheat Sheet Reference Guide – Essential Git Command Quick Guide for Beginners Developers
7 Pro Git

Pro Git

BUY & SAVE
$31.02 $59.99
Save 48%
Pro Git
+
ONE MORE?

To view the Git commit history, you can use the git log command in your terminal or command prompt. This command will display a chronological list of commits in your Git repository. Here are the steps to do it:

  1. Open your terminal or command prompt.
  2. Navigate to the directory of your Git repository using the cd command.
  3. Once in the repository directory, enter the following command: git log This command will display the commit history starting with the latest commit at the top.
  4. By default, the git log command will show you various details about each commit, such as the commit hash, author, date, and commit message. It will display one commit per line in a pager tool like less. You can scroll through the commit history using the arrow keys or press q to exit the pager tool.
  5. Optionally, you can use various flags with the git log command to customize the output. For example: git log --oneline: Displays a concise summary of each commit in a single line. git log --graph: Shows a text-based graph of the branch and merge history. git log --author=: Filters the commit history based on the author's name. git log -n : Limits the displayed commit history to the specified number of commits.

These are some basic steps to view the Git commit history using the git log command. It provides you with an overview of the repository's commit timeline, allowing you to track changes and understand the development process.

How to view the Git commit history showing the commit message and author only?

To view the Git commit history showing only the commit message and author, you can use the following command:

git log --pretty=format:'%h - %s%n - %an'

This command will show the history in a concise format with the commit hash, commit message, and author name separated by dashes. Here's what each option stands for:

  • %h: Abbreviated commit hash
  • %s: Commit message
  • %n: Newline character
  • %an: Author name

You can run this command in your project's root directory or within a specific branch or folder to see the history for that specific branch or folder only.

How to view the Git commit history for a specific file?

To view the Git commit history for a specific file, you can use the following command:

git log --follow

Replace <filename> with the specific file you want to view the commit history for.

This command will display the commit history for the file, including the commit hash, author, date, and commit message. It will also show any changes made to the file in each commit.

Additionally, if the file was renamed at some point, using --follow option helps to display the history even before the renaming occurred.

You can also add more options to the git log command to customize the output based on your needs. For example, you can use --stat to see the summary of changes made in each commit, or --oneline for a more concise view.

How to view the Git commit history in Atom?

To view the Git commit history in Atom, you need to install and use the Git Plus package. Here are the steps:

  1. Open Atom, go to "File" > "Settings" (or press Ctrl+, on Windows/Linux or Cmd+, on macOS) to open the Settings window.
  2. Select "Install" from the left-hand side menu.
  3. In the search bar, type "git-plus" and press Enter.
  4. Click the "Install" button next to the Git Plus package in the search results.
  5. Once the package is installed, close the Settings window.

Now, to view the Git commit history:

  1. Open Atom in the project that you want to view the Git history for.
  2. Press Ctrl+Shift+H on Windows/Linux or Cmd+Shift+H on macOS. You can also go to the "Packages" menu and select "Git Plus" > "History".
  3. The Git commit history will be displayed in a panel on the right side of the Atom editor.

In the Git commit history panel, you can see the commit messages, the authors, and the commit dates. You can navigate through the history using the scroll bar or the arrow keys.

How to view the Git commit history with Git Bash?

To view the Git commit history using Git Bash, you can use the "git log" command.

  1. Open Git Bash on your computer.
  2. Navigate to the repository directory using the "cd" command. For example, if your repository is located in "C:\Users\Username\Projects\my-repo", you would run:

cd C:/Users/Username/Projects/my-repo

  1. Once you are in the repository directory, run the following command to view the commit history:

git log

This will display a list of commit messages, authors, dates, and commit hashes, with the most recent commits appearing first. You can scroll through the commit history using the arrow keys, and press "Q" to exit and return to the command prompt.

How to view the Git commit history limited to a specific depth?

To view the Git commit history limited to a specific depth, you can use the --max-count flag with the git log command. Here's the syntax to follow:

git log --max-count=

Replace <depth> with the number of commit history entries you want to display. For example, if you want to view the last 5 commit entries, you would use:

git log --max-count=5

This will display the commit history limited to the desired depth.

How to view the Git commit history grouped by author or committer?

To view the Git commit history grouped by author or committer, you can use the following command:

git log --author=

Replace <author-name> with the name or email address of the author or committer you want to filter by.

For example, if you want to view the commit history grouped by the author "John Doe", you would run:

git log --author="John Doe"

This command will display only the commit history made by the specified author.

To view the commit history grouped by committer instead, you can use the --committer flag:

git log --committer=

Replace <committer-name> with the name or email address of the committer you want to filter by.

For example, to view the commit history grouped by committer "Jane Smith", you would run:

git log --committer="Jane Smith"

These commands will show the Git commit history, limited to the specified author or committer.