So your commits are being blamed on Mystery Person again. Fixing the git username is the kind of small adulting task that saves future you from awkward blame and frantic Slack messages. This guide shows how to check the current author, set a global git username, override it per repo, and verify the result using simple git commands.
Before you start meddling with config files just peek at what Git thinks your name is. Run this to see everything that matters in one list
git config --list
For a focused check run this inside a repository to see the value that actually applies there
git config user.name
That local value is what Git will use for commits in that repository. If nothing is set locally Git falls back to global config or system config if present.
If most of your work uses the same identity set a global name so you do not have to repeat yourself across projects. This writes to your global config file
git config --global user.name 'Your Name'
Use single quotes in a shell if your name has spaces. This is the tidy option for daily work and keeps knots out of the commit history.
Want a different author for one repository because you are moonlighting or doing experiment cleanup Use a local config in that repo and it will take precedence over the global setting
cd path/to/repo
git config user.name 'Repository Name'
Check the global and local user.name values independently
git config --global user.name
git config user.name
To see the author recorded on the last commit run this
git log -1 --pretty=format:%an
There you go. A few git config commands and your future self will no longer have to explain why commits come from an enigmatic alias. Now go on and make your commit history slightly less mysterious.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.