Difference between revisions of "Git log"

From NovaOrdis Knowledge Base
Jump to: navigation, search
(Overview)
(Commit with a Specific Message)
 
(One intermediate revision by the same user not shown)
Line 35: Line 35:
  
 
  git log master -- Casks/vagrant.rb
 
  git log master -- Casks/vagrant.rb
 +
 +
==Commit with a Specific Message==
 +
 +
Search the current branch:
 +
 +
git log --grep "something"
 +
 +
Search all branches:
 +
 +
git log --all --grep "something"

Latest revision as of 01:36, 1 July 2020

Internal

Overview

Show commit logs.

Commit Limiting

Commit Limiting

Use Cases

Commit History of the Current Branch

git log

Commits of a Specific User

The following command searches only the current commit's ancestors.

git log --author=ovidiu

Note that "ovidiu" will match longer strings that include it and the comparison will be case insensitive.

Commit History of an Arbitrary Branch

The branch does not have to be checked out:

git log develop
git log origin/develop

Commit History of a File from an Arbitrary Branch

git log master -- Casks/vagrant.rb

Commit with a Specific Message

Search the current branch:

git log --grep "something"

Search all branches:

git log --all --grep "something"