Think of global Git config as the ID badge your commits wear across every repo on your machine. Set it once and avoid the chaos of commit records that look like they were made by random internet avatars. This short git tutorial covers identity editor and signing so your history stays readable and trustworthy.
Before you start changing things in a panic run the basic check to see what is already set in global git config. This helps you avoid surprising yourself later.
git config --global --list
If you see unexpected values that probably explains why old commits looked like they came from someone called Unknown Developer.
These values show up in commit metadata and on services like GitHub. Pick a sensible user.name and an email to match the account you want commits attributed to.
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Use the same public email across devices for shared projects to avoid split author histories. For private work use a different email so you can be mysterious in peace.
Git needs an editor when you do interactive rebase or forget to pass a message with commit. Set one you actually know how to close.
git config --global core.editor "code --wait"
# or for the minimalists
git config --global core.editor "nano"
If you want to prove commits are really yours enable signing. Find your key and tell git about it.
gpg --list-secret-keys --keyid-format LONG
# note your key id then
git config --global user.signingkey YOURKEY
git config --global commit.gpgsign true
Signing adds a tiny bit of friction and a lot of confidence that the commit came from you and not from a CI job with attitude.
Confirm changes with the list command and edit directly when you need more control.
git config --global --list
git config --global --edit
The global file lives at ~/.gitconfig. Open it if you like hand editing or need to copy settings to a new machine.
If you follow these steps your command line git experience will be less chaotic and more predictable. That is a low bar but very satisfying to clear.
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.