Answer the question
In order to leave comments, you need to log in
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.
Answer the question
In order to leave comments, you need to log in
You do a PULL first - update your LOCAL repository to a REMOTE state. Make the necessary changes and then PUSH.
git pull --rebase
Pull with this flag and everything will be kosher
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 questionAsk a Question
731 491 924 answers to any question