C
C
Chekistchek2017-07-27 13:53:51
git
Chekistchek, 2017-07-27 13:53:51

Unable to update files, what should I do?

I updated the files on github, but then I noticed that there is a typo. I decided to fix it in github itself, everything seemed to be fine, but now when I try to update via the command line, it gives an error:

To https://github.com/...
! [rejected] master -> master (fetch first)
error: failed to push some refs to ' https://github.com/... '
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: (eg, 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I'm a noob over ∞ at this, so don't say, "How can you not know that").
I hope for your help.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2017-07-27
@Chekistchek

You do a PULL first - update your LOCAL repository to a REMOTE state. Make the necessary changes and then PUSH.

A
Alexey Ovdienko, 2017-07-27
@doubledare

git pull --rebase
Pull with this flag and everything will be kosher

R
Roman Mirilaczvili, 2017-07-27
@2ord

You can see right there in the message


hint: to the same ref. You may want to first integrate the remote changes
hint: (eg, ' git pull ...') before pushing again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question