简体   繁体   中英

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.

在此处输入图片说明

I have a Bitbucket account and created a new repository and I have given the link of it. 在此处输入图片说明

Then I tried to push the content of local git to remote repository in Bitbucket. But I get an error message. 在此处输入图片说明

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

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM