Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › code provenance

git blame Told Me I Wrote 767 Lines I Didn’t Write: What It Actually Reports and How to Trace the Real History

By Freedom251 Team · · 5 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Because git blame reports the last commit that touched each line, it can credit you with code you never composed. In a DEV Community post from September 2026, a developer who goes by Lex described exactly this. An automated updater copied upstream files into a fork, Lex committed the result, and blame assigned all 767 lines to the local commit. Git did nothing wrong. The command answered a narrower question than the one people usually ask of it.

What git blame actually answers

Git’s documentation describes git blame as annotating each line of a file with information from the revision that last modified it. That is a statement about repository history. It is not a statement about who thought up, typed or originally published the line.

As an Amazon Associate I earn from qualifying purchases.

When bytes arrive in a commit, blame cannot tell whether a person wrote them, a tool generated them, or they were copied from somewhere else. If the commit’s diff shows the line as added or changed, that commit gets the credit. A vendored update, a bulk sync, a generated file or a mechanical reformat will all produce the same effect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The incident, in the author’s words and numbers

According to Lex’s account, an automated update wrote upstream files into the author’s fork, and the author committed those files. Local blame then named the author as the source of all 767 lines, even though, by the author’s account, the underlying code came from upstream. The repository itself was not independently reviewed for this article, so the details below are the author’s report.

The useful part is what happened next. Lex ran blame against origin/main, the upstream history, and got a different picture: three contributors with 301, 246 and 66 surviving lines respectively. An earlier contributor’s lines no longer survived in current blame. Those are counts for that one file set in that one repository. They are not a Git statistic and not a measure of anyone’s overall contribution.

How to investigate when blame points at you (or someone else) unexpectedly

  1. Look at the commit blame names. Run git show <commit> or git show --stat <commit>. A commit that touches hundreds of lines across many files, with a message like “update” or “sync”, is a candidate for an import.
  2. Read the message and compare with the parent. Check what the commit says about its source, and diff it against its parent to see whether the change looks like a wholesale replacement.
  3. Identify the mechanism that wrote the files. In Lex’s case this was an automated updater. A script, bot, submodule-like sync or code generator leaves traces in its configuration and logs.
  4. Blame against the upstream history. If the upstream remote is configured, run blame at the upstream reference, for example git blame origin/main -- path/to/file. The result is only as meaningful as the remotes: it assumes origin really is the upstream whose history you want, and that the history was fetched. In a fork, upstream is often a separate remote, so check git remote -v first.
  5. Compare the local file with upstream. Do not assume the latest committer created every line. Diffing the local file with the upstream version shows what is identical and what you actually changed.

Blame options that change what it reports

Git documents several options that alter how lines are attributed. They help with some investigations, but none guarantees recovery of original authorship. Check the behavior against the Git version you have installed.

Question Option What it does
Was this line moved or copied within the same file? -M Detects moved or copied lines inside a file, so credit can stay with the earlier commit.
Did it come from another file? -C Detects lines moved or copied across files.
Is a known mechanical commit hiding the real history? --ignore-rev <commit> Treats the named revision as if it did not change the lines, passing blame to earlier history.
Are there several such commits? --ignore-revs-file <file> Reads a list of revisions to ignore.

These options only work on history that exists in the repository. If the import was a plain file copy committed in one step, with no earlier copy of those lines in the history you have, -M and -C have nothing to find. That is why the upstream comparison above matters.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ignoring revisions changes the attribution view you are looking at. The result is a different reading of history, not proof about who wrote anything. If you share it, say which revisions were ignored.

Finding when a snippet entered history

Git’s documentation also points to history search for the question “when did this code appear, move or disappear?” Blame is the wrong tool for that. Commands such as git log -S "some text" (changes in the count of a string) and git log -G "regex" (changes matching a pattern) list the commits that introduced or removed matching text. Use them when you need the first appearance of a fragment rather than the last modification of a line.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

The second lesson: a source-support gate checks backing, not truth

The same post describes a gate that checks whether each claim in generated output has backing text in a set of source files. Lex reports that it rejected four real concepts because the output used synonyms not present in the source files, and later rejected an unsupported number. The rule was whether a claim had support in the sources, not whether it was true in the world. That is the same shape of mistake as blame: a check that is accurate about its own narrow question, and easy to read as answering a broader one.

The practical takeaways from the account are modest:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Maintain the source corpus the gate checks against.
  • Keep the configuration that lists allowed facts under version control.
  • Record provenance for any allowed figure.
  • Expect a strict check to reject true statements whose wording the sources lack.

The evidence is thin, and the author says so. The gate had been wired in for four days, with three abort messages in the logs. Notes suggested roughly six, but those overlapped the logs, and the author treats three as the defensible logged count. There was no aggregate counter and no control group. Treat it as one operator’s observed case, not an effectiveness rate. No population-level figure turned up for how often blame is mistaken for authorship, or for how well claim-checking gates work generally.

Reporting blame results responsibly

  • Say “last modified by” rather than “written by”.
  • Name the reference you blamed against (local HEAD, origin/main) and any ignored revisions or -M/-C flags.
  • If a commit is an import, say so and point to the upstream source.
  • Remember that surviving-line counts describe what remains in the current file, not the effort of people whose lines were later replaced.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

code provenanceForksGitgit blameVersion Control

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.