Skip to content

    Git blame

    Reading time: 2 min.Editorially reviewed on:

    Definition

    Git Blame shows which commit last changed individual lines of a file version.

    Git Blame assigns lines of a versioned file to the commit that last changed them. The output includes commit and author information, among others. It describes the traceable change history of a chosen version, not responsibility for an error.

    Simply explained

    You can check for a code line which change created it in this form.

    Why it matters in practice

    This facilitates understanding unknown parts and leads to commit messages or related changes with further technical context.

    Example from business

    Possible example: A developer investigates an unexpected calculation and reads via Git Blame the change that last touched this line.

    Limits and pitfalls

    • The last change is not necessarily the cause of a problem. Pure formatting can obscure the attribution; deleted lines are not visible in the current version.

    Origin & history

    Line-based provenance analyses complement the cross-file commit history. Git can also consider renames and, with appropriate options, moved or copied lines.

    Use in mid-sized companies

    • A team uses the line history as an entry point for root cause analysis and then reviews the entire commit along with the technical context.

    Frequently asked questions

    Does Git Blame show who caused an error?

    No. It initially shows the last recorded change of a line; the cause may lie elsewhere.

    Sources

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice