You need to:
Make sure your ~/.ssh/config
file has an 'myNewAccount
' entry
Host heroku.myNewAccount
HostName heroku.com
IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa
IdentitiesOnly yes
And then change the remote 'origin' url:
git remote set-url origin [email protected]:<appname>.git
Or, as Ian Vaughan comments below
origin
is normally heroku
when using the 'heroku-toolbelt':
git remote set-url heroku [email protected]:<appname>.git
That last step will make sure the git push
will use your new account, and not the old one.
See more at "Multiple heroku accounts".
If you add "User git" in your config file, you can remove the credential user name 'git
':
Host heroku.myNewAccount
User git
HostName heroku.com
IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa
IdentitiesOnly yes
That means you can use:
git remote set-url origin heroku.myNewAccount:<appname>.git
# or
git remote set-url heroku heroku.myNewAccount:<appname>.git
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…