VOSH
VOSH

Reputation: 123

Cannot push local repository to remote Bitbucket

I have configured a local bit repository and have several test commits with files in it.Status is available as follows.

enter image description here

I have a Bitbucket account and created a new repository and I have given the link of it. enter image description here

Then I tried to push the content of local git to remote repository in Bitbucket. But I get an error message. enter image description here

How to get this sorted? Thanks in advance for any help!!!

Upvotes: 0

Views: 622

Answers (3)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 522762

If I read the error message correctly, it looks like there are commit(s) on the remote branch which you don't have locally. Try pulling first:

git pull -u origin master

Then try your push:

git push -u origin master

Upvotes: 1

Akshay komarla
Akshay komarla

Reputation: 744

Follow these commands.

git add .
git commit -m "your commit message"
git push -u origin master.

if any changes were not pulled initially u need to pull first

git pull -u origin master

Upvotes: 0

Francesco Iannazzo
Francesco Iannazzo

Reputation: 626

Your have to fetch first the changes from the remote repository and the push

again.

  git fetch origin master
  git checkout master

Take a look here https://blog.plover.com/prog/git-ff-error.html

Upvotes: 1

Related Questions