node.js - Heroku: Git error after application fork -
setup:
i have node.js (mean fullstack) application (ie. myapp) deployed on heroku works fine. deploy standard git push
$ git push heroku master
i wanted create staging replica of application , used heroku fork (as per https://devcenter.heroku.com/articles/fork-app) .
$ heroku fork -a myapp myapp-staging
the staging application works fine its' own database , has its' own set of config variables (es expected). !!! important
i created new git remote
$ git remote add staging git@heroku.com:myapp-staging.git // repo address taken "heroku info -a myapp-staging"
problem:
1) if try push production ie. "git push heroku master" works fine.
2) if try push staging
$ git push staging master
i "permission denied (publickey)."
3) if try clone staging application git repo directory empty repo
$ heroku git:clone -a industryhub-staging // warning: appear have cloned empty repository
where staging repo? code heroku running on staging instance? - how push staging?
figured out. here posterity.
the error wrong remote staging app. created with
$ git remote add staging git@heroku.com:myapp-staging.git
and had
$ git remote -v heroku https://git.heroku.com/myapp.git (fetch) heroku https://git.heroku.com/myapp.git (push) staging git@heroku.com:myapp-staging.git (fetch) // wrong staging git@heroku.com:myapp-staging.git (push) // wrong
i should have done
$ git remote add staging https://git.heroku.com/myapp-staging.git // on https
now git shows
$ git remote -v heroku https://git.heroku.com/myapp.git (fetch) heroku https://git.heroku.com/myapp.git (push) staging https://git.heroku.com/myapp-staging.git (fetch) // ok staging https://git.heroku.com/myapp-staging.git (push) // ok
and life peachy again!
note: heroku says new repo empty after forking app. https://devcenter.heroku.com/articles/fork-app#forked-app-state
Comments
Post a Comment