Monday, January 13, 2025

Usefull Git Log Commands

It shows the commits and the files afected with diff

 
  git log -p
  

It shows the commits and the name of file afected in that commit

 
  git log --stat
  

It shows log in your custom output format

 
  git log --pretty=format:"%h - %an, %ar: %s"
  

It shows log limited by a period, for example 2 weeks in the following command

 
  git log --since=2.weeks
  

Find the last commit that added or remove a reference to a specific function, you could call

 
  git log -Sfunction_name
  

No comments:

Post a Comment