↑ ↓ select, Enter open, Esc close

Find out who changed specific lines of a file

Adjust the values, the command updates live
user@server
git blame -L 10,40 wp-config.php

Prints the short commit hash, author, date and line content for every line in the given range. With the hash, git show displays the complete commit including its message. Useful when a configuration line suddenly looks different and you are looking for the cause.

Note: -w ignores whitespace-only changes, and -C also follows moved or copied lines.

Also searched as

  • who changed this line git
  • git blame specific lines
  • find author of a line of code

Related one-liners

All in Git

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.