git blame

Show who last modified each line of a file and when

Syntax

git blame [<options>] [<rev>] [--] <file>

Parameters

ParametersDescriptionExamplesLevel
-L <start>,<end> Common
-w Common
-C Copy Common
-e Common
--since <date> Common

Examples

git blame src/utils.js
a1b2c3d ( 2024-03-15) function formatDate() {

10-20

git blame -L 10,20 src/app.js

,

git blame -w src/style.css

Copy

git blame -C src/newFile.js

log

git log --follow -p -- src/utils.js

Tips

Related Commands