-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bf5d91
commit ec5bfb0
Showing
1 changed file
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
--- | ||
title: View a summary of changes between two commits | ||
type: snippet | ||
title: View a summary of changes between two Git commits | ||
shortTitle: View changes summary | ||
type: tip | ||
language: git | ||
tags: [repository,branch] | ||
cover: taking-photos | ||
dateModified: 2021-04-13 | ||
excerpt: Learn how to view a summary of changes between two Git commits, using a single command. | ||
dateModified: 2024-04-24 | ||
--- | ||
|
||
Prints a summary of changes between two given commits. | ||
Have you ever wanted to see the **changes between two commits** in a Git repository without having to go through the entire commit history? A summary of changes can help you understand the differences between two commits quickly. So how can you do that? | ||
|
||
- Use `git shortlog <commit>..<other-commit>` to view a summary of changes between the two given commits. | ||
- Use arrow keys to navigate, press <kbd>Q</kbd> to exit. | ||
Using `git shortlog <commit>..<other-commit>`, you can view a summary of changes between two given commits. Note that the two commits **don't have to be consecutive**, and you can use any valid commit references, such as **commit hashes**, **branch names**, or **tags**. This allows you to compare any two points in the repository's history. | ||
|
||
As usual, you can navigate through the summary using the arrow keys and exit by pressing <kbd>Q</kbd>. | ||
|
||
```shell | ||
git shortlog <commit>..<other-commit> | ||
# Syntax: git shortlog <commit>..<other-commit> | ||
|
||
# Examples | ||
git shortlog 3050fc0de..HEAD | ||
# Duck Quacking (2): | ||
# Fix network bug | ||
# Update documentation | ||
|
||
git shortlog v1.0..v2.0 | ||
# Duck Quacking (2): | ||
# Add new feature | ||
# Update dependencies | ||
|
||
git shortlog master..feature-branch | ||
# Duck Quacking (2): | ||
# Add new feature | ||
# Update documentation | ||
``` |