Sign inSign up free

781. Hide a Reformatting Commit From git blame

medium 20 XP ~7 minHands-on lab

Last week someone ran the code formatter over the whole of /home/student/repos/billing-service in one commit ("Apply formatter to all files"). Now git blame attributes almost every line to that commit, and nobody can see who wrote what.

Task

  • Create .git-blame-ignore-revs at the top of the repository, listing the full ID of the formatter commit (with a comment line explaining it), and commit it on main.
  • Configure this clone so that a plain git blame uses that file automatically.

Afterwards, git blame app.py must show the real authors again.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of Git Essentials. Next step: Move a Repository Without a Network

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.