Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push error while pushing to remote repository

Tags:

git

heroku

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?

like image 414
misguided Avatar asked Apr 06 '13 00:04

misguided


People also ask

How do I fix error failed to push some refs to git?

We can fix the error: failed to push some refs to [remote repo] error in Git using the git pull origin [branch] or git pull --rebase origin [branch] commands. In most cases, the latter fixes the error.

Why git push is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

How do I push to a remote git repository?

In order to push a Git branch to remote, you need to execute the “git push” command and specify the remote as well as the branch name to be pushed. If you are not already on the branch that you want to push, you can execute the “git checkout” command to switch to your branch.

Why can't I push code to GitHub?

To push a branch on remote, your branch needs to have the latest changes present in remote repository. If you get the failed to push error, first do git pull the branch to get the latest commits and then push it.


1 Answers

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:

  • nice SO question in the subject
  • Git Guys explain remote section of config
like image 83
LAFK says Reinstate Monica Avatar answered Oct 20 '22 05:10

LAFK says Reinstate Monica