-1

I am trying to push, but I got this error

https://bitbucket.org/ramonet/olives.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://ramonet@bitbucket.org/pramonet/olives.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I've tried to pull with this result:

git pull remote master
fatal: 'remote' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  • Not only does the error message tell you what went wrong, it even tells you what to do! `git pull` before pushing. – Andrey Tyukin Jan 21 '18 at 17:56
  • Bro the error mssg is clear enough to understand whats goin on...probably you made some changes in the main repo and then you are trying to push your your files,thats why the error.Try ‘git pull’ before pushing so that the files get synced at both ends. – DeadCoderz Jan 21 '18 at 18:00
  • 1
    Possible duplicate of [Cannot push to GitHub - keeps saying need merge](https://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge) – phd Jan 21 '18 at 19:19

4 Answers4

0

Try doing a git pull first. git pull Then do a: git push

It appears that your remote master branch is actually ahead of the master branch on your local system. i.e. The master branch of your repository on BitBucket is 1 or more commits ahead of your local repository.

0

You most probably want to do a

git pull origin master

before pushing. This could ask you to merge your current commit with the last commit on the master branch in the origin repository. Apparently, you aren't so sure about the name of the remote repository. Check what

git remote -v

tells you: it should list all addresses and short names of remote repositories. Most probably there will be a repository called origin. If it's somethingElse instead of origin, then do

git pull somethingElse master

before doing a

git push somethingElse master
Andrey Tyukin
  • 43,673
  • 4
  • 57
  • 93
0

This means that someone has already pushed some changes on the remote that you don’t have on local.

So, you need to take a pull from remote

git pull origin master

then push to remote

git push origin master
Ashish Agrawal
  • 371
  • 1
  • 4
  • 17
0

You have 2 problems:

Problem#1. Not able to push: Because somebody has made some changes that is not in your local version of master.

Solution: pull the changes first and then push:

`git pull 
 git push`

Problem#2. Not able to pull and getting error as 'remote' does not appear to be a git repository:

a. Looks like you are not pulling from correct remote. Check the remote name . In most cases it is origin, you can check your remote name with:

git remote -v

The output would be :

<remote-name> <repo link> (fetch) <remote-name> <repo link> (push)

Now pull from the correct remote: git pull remote <remote-name>

b. If the above step does not work, check if you have correct access rights to repository.

Priya Jain
  • 795
  • 5
  • 15