Command

Git Compact Commit History Command

The Git command to compact commit history is git log --oneline.

Quick Answer

Command
git log --oneline
GitCommand

Compact Commit History

Type this command
git log --oneline

Shows the history one line per commit.

Learn More

How to compact commit history in Git

  1. Open the terminal or command interface for Git.
  2. Type git log --oneline, replace any placeholders, and run it.

Git Compact Commit History Command

Run git log --oneline.

Related Commands

Frequently asked questions

What is the Git command to compact commit history?

Run git log --oneline.

Where do I type this Git command?

Type it in the terminal or command-line interface used by Git.

Does this Git command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify