Error message:
error: failed to push some refs to '[email protected]:....." Updates were rejected because the remote contains work that you do not have locally.
This is usually caused by another repository pushing to
Cause analysis:
1. This error may occur when using git to push the source code to GitHub
2. The main reason for the error is that the readme.md file in GitHub is not in the local code directory
Solutiont:
Method 1: pull it down first and it will merge automatically (don’t worry)
Command: git pull origin master
Method 2: Code merging can be carried out through the following commands
Command: git pull — rebase origin master (my successful solution is method 2)
Finally, execute the statement git push to upload the code to GitHub
Command: git push – U origin master
Read More:
- Git Push Error: failed to push some refs to ‘[email protected]:
- [Solved] Git submits locally to the remote warehouse Error: failed to push some refs to…
- Git Push Error: error: failed to push some refs… hint: Updates were rejected because the remote…
- [Solved] error: failed to push some refs to ‘https://gitee.com/wangdxstudy/mygirl.git‘
- Local repository upload to remote repository error: failed to push some refs to ‘https://hub.fastgit.org/zhizhangxuezhang/ui-test.git‘
- [Solved] Git Common Error: error: src refspec xxx does not match any/error: failed to push some refs to
- How to Solve Git Push Error: error: src refspec v3.3.04.1000 matches more than one
- Git push Failed to connect to localhost port 1080 [How to Solve]
- Git pull and Git pull origin master Warning: Pulling without specifying how to reconcile divergent branches
- [Solved] Git error: refname refs/heads/master not found
- How to Solve Git error: out of memory
- Git: How to Solve Error: Please commit your changes or stash them before you merge.
- How to Solve Git Error: error: unable to unlink old ‘***.jar‘
- How to Solve Git submodule update error
- Git push Submit to Remote Error: “remote: Support for password authentication was removed on August 13, 2021.“
- How to Solve Error: cannot open .Git/fetch_HEAD: Permission denied
- Git Push remote error: GH007: Your push would publish a private email address.
- Git fatal: No configured push destination. Either specify the URL from the command-line or co
- [Solved] Git Push Error: &fatal: the remote end hung up unexpectedly
- How to Solve Logstash error: failed to execute action