How to view the Git commit history?

Member

by daisha , in category: Third Party Scripts , a year ago

How to view the Git commit history?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by jerad , a year ago

@daisha 

To view the Git commit history, you can use the following command:

1
git log


This command displays a list of commits in reverse chronological order, with the most recent commit appearing first. Each commit is displayed with information such as the commit hash, author, date, and commit message.


You can also use various options with the git log command to customize the output. For example, you can use the --oneline option to display each commit on a single line, or the --graph option to show a graphical representation of the commit history.


Here are some common options that can be used with git log:

  • --abbrev-commit or -abbrev-commit: Show the commit hash as a shorter, abbreviated version.
  • --author=: Show commits only by a specific author.
  • --after=: Show commits after a specific date.
  • --before=: Show commits before a specific date.
  • --grep=: Show commits containing a specific pattern in the commit message.
  • --stat: Show the files changed in each commit along with the number of insertions and deletions.


You can combine these options to filter and customize the commit history according to your needs.