misguided
misguided

Reputation: 3799

git push error while pushing to remote repository

I am getting the following error while trying to push the changes to remote repository.

Command

git push heroku

Error

fatal: You are pushing to remote 'heroku', which is not the upstream of your current branch 'master', without telling me what to push to update which remote branch.

Can anyone please advise what might be causing the same?

Upvotes: 12

Views: 15593

Answers (3)

user1293367
user1293367

Reputation: 19

It could be more simple than that, try to run heroku login, if heroku is not reconigzed as a command you simple don't have the heroku toolbelt installed if that is the case follow the instructions on that site https://toolbelt.heroku.com/debian for your OS

Upvotes: -4

benxgao
benxgao

Reputation: 371

git config -l will show you:

[branch.master.remote] and [branch.master.merge]

Actually, they are the default behaviors of git pull/push, for example, git push == git push [branch.master.remote] [branch.master.merge].

By default, [branch.master.remote] = origin, [branch.master.merge] = master, so in this situation git push = git push origin master.

However, in your situation, your origin [branch.master.remote] is not heroku, and git does not know which branch of heroku* you wanna push to, so you must point it for git.

Upvotes: 7

I suspect you don't have remote configured.

push likes to know WHAT to push and WHERE to push it. Usually one configures git so that it automatically tracks branches (local - remote pairs).

Try pushing: git push heroku master assuming master is your local branch and heroku is a remote.

Also, to see if remote is not configured, (l)ist your config or (e)dit it: git config -l / -e

Since Felix was before me, I'll extend my answer with setting the remote:

Upvotes: 22

Related Questions