Not necessarily. It's just to prevent accidentally committing private keys to a public repository.