error when using the command git push -u origin -all in windows

0

I'm linking my first Ruby application to Windows with a remote repository, but I'm staying at this point:

First I add the origin and it works well:

C:\Sites\hello_app>git remote add origin [email protected]:lurisnel/hello_app.git

But then when doing push I always get the same error:

C:\Sites\hello_app>git push -u origin --all
To [email protected]:lurisnel/hello_app.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:lurisnel/hello_app.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I already created an account in bitbucket and I have a repository called hello_app .

Thank you in advance for your help.

    
asked by Lurisnel 11.11.2017 в 13:48
source

1 answer

0

The error is because the remote repository has changes that you have not yet reflected in your local repository.

Confirm that your repository is correct and, if so, update your local repository with those changes:

First download the code:

git fetch origin

Check the changes that were made (to make sure they will not hurt your current code).

Once you confirm, update your repository:

git merge origin/master

When you finish the merge (resolving conflicts if they exist) you can do push without problem.

    
answered by 11.11.2017 в 15:03