I'm following a book about Django and when I'm trying to push my file to Bitbucket repo , I got this error : I wrote in cmd:
git init
git status
git add -A
git commit -m "comment"
-Creating a account in Bitbucket
in cmd:
git remote add origin https://dd@bitbucket.org/dd/simple-app.git
git push -u origin master
I received this Error:
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://dd@bitbucket.org/dd/simple-app.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.
Hi and welcome to the Community.
The error explains what is happening. You need to pull down changes from the remote before pushing your local changes. When you created the repo in Bitbucket, it may have created a README which would be the first commit of the git repo.
# pull changes from the remote origin
git pull
# view the commit log
git log
# if the log looks okay
git push -u origin master
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.