Signing Commits & Pro Config

Signing commits (trust)

Anyone can set user.name to yours and commit as "you". Signed commits (GPG or SSH) cryptographically prove authorship - hence GitHub's green "Verified" badge.

$ git config --global commit.gpgsign true
$ git config --global user.signingkey <key-id>
$ git commit -S -m "Signed commit"    # -S signs a single commit

Config levels & aliases

ScopeFlagFile
System--system/etc/gitconfig
Global (you)--global~/.gitconfig
Local (repo)--local.git/config

More specific wins: local overrides global overrides system.

$ git config --global alias.lg "log --oneline --graph --all"
$ git config --global alias.st status
$ git lg      # now your custom shortcut
Tip: A few aliases (lg, st, co) and pull.rebase=true will noticeably speed up your daily Git. Set once with --global and every repo inherits them.
Goal: You've now covered Git end to end - fundamentals, branching, collaboration, history surgery, and the professional power tools. Pair each topic with the Git labs to make it muscle memory.