Home git failed to push some refs

failed to push some refs




What’s the problem? Public key configured.

$ git push origin master
To https://github.com/merrymaker14/uploadca.git
! [rejected] master - & gt; master (fetch first)
error: failed to push some refs to https://github.com/merrymaker14/uploadca.git '
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
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.

Answer 1, authority 100%

There are changes in the repository on the server that appeared there after you cloned. Most likely, someone has already pushed the changes into it. To avoid conflicts in the future, the system does not allow you to push your changes until you update your repository.

First, you need to download the changes to yourself locally:

git pull

In case of conflicts, resolve them, after which the system will allow you to run git push .

Answer 2, authority 8%

It could also be because the files are still in use by another program.
if you just have

error: failed to push some refs to ‘https://gitlab.com/ …’

Answer 3

There was a problem like this just on gitlab with a new project. I solved it by this method:
1. Created a readme file on the site itself in master
2.made a git clone
3.created a develop branch
4. uploaded the project to the current repository
5. pushed develop

Answer 4

I will add for history, this can be, if there is still nothing to push. With a clean repository, try pushing instead of the first commit

Answer 5

git push –force
Your problem was due to the fact that someone made changes to the remote repository, and you are forced to download updates to yourself (git pull)
But with the help of the top command (git push –force) I make it clear that I do not want to clone the version updated on the remote repository to myself

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions