modified part of the project today, and then pushed origin master to the remote warehouse with git, the following error was reported:
error: failed to push some refs to 'https://github.com/ZJyoung1997/JZShop.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.
The reason is that the files in the remote warehouse are different from our local warehouse. For example, your remote warehouse has a file readme.md, but the local warehouse does not. mine is caused by having the readme.md file in the remote warehouse and not having it in the local warehouse. In addition, I usually use the association's computer to develop, and then use my own computer to develop after I return to the dormitory, which may also be the cause of this problem. In this case, the solution would be to clone the local repository directly and then clone it from the remote repository, but this would be too cumbersome, and the branch merge method
could be used
solution:
git pull --rebase origin master
The
git pull command is used to get and integrate (consolidate) from another repository or local branch, fetch updates to a branch on the remote host, and merge with the local specified branch.
if the following error is reported, you can also use the git pull
command
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
with git pull origin master - allow - unrelated - nothing code> solution p>
Read More:
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- git push error failed to push some refs to solution
- [Git & GitHub] Solution: error: failed to push some refs to’https://github.com/xxxx.git’
- GitHub upload failed: git push error: failed to push some refs to exception handling
- Solve github :error: failed to push some refs to problem
- ! [rejected]master -> master error: failed to push some refs to’https://github.com/ The ultimate solution
- error: src refspec master does not match anyerror: failed to push some refs to
- error: src refspec master does not match any error:failed to push some refs to ‘[email protected]:xxxx
- Failed to push some refs to
- How to solve error: failed to push some refs to ‘[email protected]:……git pull conflict
- Error: SRC refspec master does not match any. error: failed to push some refs to
- How to Fix GIT Push Error
- Push failed Unable to access ‘https://github.com/‘: Failed to connect to github.com port 443: Timed
- Git push you are not allowed to upload merges
- [FAQ] after git merge, the push to Gerrit fails, indicating no new changes?
- Git push “fatal: Authentication failed ”
- GitLab You are not allowed to push code to this project
- Jenkins docker push to harbor to report error
- [Git] git pull pull remote git push to remote git commit submit reject
- You are not allowed to upload merges in Git push