You set up a new laptop and forgot to configure git. Last 4 commits show `you@old-job.com`. Your manager wants the company email everywhere.
Fix the config first, then re-author the tip with `--amend --reset-author`. The three older commits need a full history rewrite (`rebase --exec` or filter-repo), which needs an editor this terminal has not got.
Medium · 4 steps · +500 XP
This scenario walks through 4 steps, in order:
Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.
git config user.email you@new-job.comgit config --listgit commit --amend --reset-author --no-editgit push --force-with-lease`--amend --reset-author` re-stamps the commit you are sitting on; anything older needs a history rewrite. Set user.email globally on every machine and you never have to do either.