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
| Scope | Flag | File |
|---|---|---|
| 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) andpull.rebase=truewill noticeably speed up your daily Git. Set once with--globaland 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.