When cloning, core.defaultBranchName should be set based on refs/remotes/origin/HEAD.
core.defaultBranchName
refs/remotes/origin/HEAD
Cc: @brad.king