Git Blaming

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • git blame [filename]
  • git blame [-f][-e][-w] [filename]
  • git blame [-L range] [filename]

Parameters

ParameterDetails
filenameName of the file for which details need to be checked
-fShow the file name in the origin commit
-eShow the author email instead of author name
-wIgnore white spaces while making a comparison between child and parent's version
-L start,endShow only the given line range Example: git blame -L 1,2 [filename]
--show-statsShows additional statistics at end of blame output
-lShow long rev (Default: off)
-tShow raw timestamp (Default: off)
-reverseWalk history forward instead of backward
-p, --porcelainOutput for machine consumption
-MDetect moved or copied lines within a file
-CIn addition to -M, detect lines moved or copied from other files that were modified in the same commit
-hShow the help message
-cUse the same output mode as git-annotate (Default: off)
-nShow the line number in the original commit (Default: off)

Remarks

The git blame command is very useful when it comes to know who has made changes to a file on a per line base.



Got any Git Question?