If your commits look like they came from a witness protection program it is usually because git does not have the right email for your commits. This guide shows how to check set and fix your git user email so commits show up under the identity you actually want on GitHub and other hosts.
Want to know what email new commits will carry? Run these inside a repo to see local and global values
git config user.email
git config --global user.email
If the first command prints nothing git falls back to the global value. If both are empty your commits might look annoyingly anonymous.
The global setting applies to every repository on this machine unless a repo overrides it. Great for a personal laptop where you do 90 percent of your life
git config --global user.email "you@example.com"
Need a separate work identity for that corporate repo? Set the email while inside the project folder and only that repo will use it
git config user.email "you@work.com"
Do not trust hope or a hunch. Confirm what changed with these commands
git config --global --list
to see global entriesgit config --local --list
to see repo level entriesgit config --list
to see the effective valuesTo correct the most recent commit without changing the message run
git commit --amend --author="Your Name " --no-edit
To edit many commits use an interactive rebase and rewrite the author information for the affected commits
git rebase -i HEAD~N
There are also history rewrite tools for bulk changes. Warning rewriting published history can frustrate collaborators and cause merge drama Do not rewrite shared branches without coordinating first.
That covers checking setting verifying and repairing git email values. Now go commit like the professional you pretend to be.
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.