I had a situation, where I git pushed, then, I changed the commit message causing a new checksum on that commit. Then when I tried to push next time the remote had changes which were not stored in my local repository, so i did a git pull and all good.
To my error message:
I tried to do a git push heroku
and it said that the heroku repository did not exist. I could not think of a reason why this was possibly other than I have everything on a external harddrive and I did some work on my laptop but did not push to heroku or anything and besides everything is in my .git folder and I didnt change anything.
I did a I believe
git remote -a heroku git@heroku.com:myapp.git
git remote
heroku
origin
Now it says this is set. But I try do a git push heroku
and I get the error;
To https://git.heroku.com/myapp.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I never looked into git to much other than doing the normal git commands and pushing to origin and to heroku. What is this error message telling me?
I looked into my .git folder under refs/remotes
and there is only origin
folder, no heroku
. I cannot understand what has happened here.
P.S I realise I should never have had to of made another heroku remote locally but my .git
folder was hidden on windows and I could not inspect it to see if my refs/remotes/heroku
was there (as it shoud be) and posted a question about this.
Thanks.
EDITTTTTTTTTTTT: The answer here may be something quite strange. I copied my myapp
folder to a external drive but the .git
folder must have went with it but like the error shows, there doesn't seem to be any heroku remote so I still cant understand why its like heroku remote has vanished. Either way, the last push to heroku was when my app folder was not on the external drive. It seems something has happened...