N
N
Nikita Salnikov2022-01-03 13:05:41
git
Nikita Salnikov, 2022-01-03 13:05:41

Why can't I push changes to a github page?

Why can't I push changes to the github page? There is a project folder. At first I added ka as usual, everything was added. Now I have made changes to this project in this folder and added other pages and elements, I want to add their repository with the commands:

git add .
git commit -m 'add new pages'
git push Blog master

But it doesn't work for me and I get an error:

error: failed to push some refs to 'github.com:nikitasalnikov/Blog.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.

All actions take place on the same computer in the same folder.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2022-01-03
@bingo347

Have you tried reading the error? It's all there...
You need to do a git pull before a git push to get the changes you don't have locally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question