Getting the host key can be a pain so the following is a quick and dirty solution;
1st backup and clear out your ~/.ssh/known_hosts file, then connect to each host with ssh, which will prompt you with host hash fingerprint. Verify these and accept the connection.
When you're done doing that you can do

heroku config:set GIT_HOST_HASH="`cat ~/.ssh/known_hosts`"

Then restore your known_hosts backup file.

Step 3

Use this custom repository as custom buildpack for heroku deployment.
This buildpack should be executed first as it takes care of setting up the SSH environment, for accessing private
repos.

Development / Testing

WARNING

Testing on your local machine with the test runner will clobber ~/.ssh/known_hosts and ~/.ssh/private_key file if they exist. I just destroyed my ~/.ssh/id_rsa and ~/.ssh/known_hosts testing this. I renamed the key being used to private_key (also because we can't be sure it'll be an RSA id anyway) so it should be less devastating but you've been warned. Best is probably to chmod everything in ~/.ssh to 0400.