Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git blame

Show last modification info for each line

Syntax

git blame [options] <file>

Common Options

OptionDescription
-L <start>,<end>Show only specified line range
-L <start>,+<n>Show n lines from start
--show-nameShow original filename
--date=<format>Specify date format
-CDetect copies and moves
-MDetect line moves
-eShow author email
-wIgnore whitespace changes

Examples

git blame file.txt

Show line-by-line blame info

git blame -L 10,50 file.txt

Show lines 10 to 50

git blame -L "/^function/",+20 file.js

Show 20 lines from function start

git blame -C -L 1,100 file.txt

Track code copy origin

Related Commands

git loggit diffgit showgit shortlog

Related Tools

More Code & Dev Tools