Some people who understand TLS very well (because they develop a TLS library), use this in their #Git config file. Maybe everyone else should use this, too.
[http "https://github.com/"]
pinnedpubkey = sha256//8gWWkWa8AfAz0khtRYRodss7ieQPpu8Sd7DppK94eVo=