Git:虽然我已经完成了git pull,但未能推送一些裁判 [英] Git: failed to push some refs although I have done git pull
问题描述
当我更改了某些文件并试图推送时,我开始得到无法推送某些文件的错误。大多数指令都告诉先做git pull。我已经做到了,git说一切都是最新的。任何想法如何解决错误?我也开始收到'没有可用的版本信息'的消息,我不知道是否与错误有关。
git push origin master
git:/usr/local/lib/libz.so.1:没有可用的版本信息(需要git)
输入密钥'/root/.ssh/id_rsa' :
给git @ [mydomain] .beanstalkapp.com:/repo-git.git
! [被拒绝] master - > master(非快速转发)
错误:未能将某些文件推送到'git @ [mydomain] .beanstalkapp.com:/repo-git.git'
错误在于别人已经将 master 如果
git
允许你推送(这就是非快速转发
错误的意思),你会覆盖它们的改变。 。因此,您需要将本地 master
分支与远程 master
分支合并。
如果您在执行 git pull
时本地分支不是 master
分支,就会发生这种情况。如果您只想推送您正在使用的分支,而不是 master
分支,则需要将其分配给 git
使用完整形式的 git-push
:
$ git push远程本地分支:远程分支
I started to get 'failed to push some refs' error when I changed some files and tried to do push. Most instructions tell to do git pull first. I have done it and git says everything is up to date. Any idea how to solve the error? I also started getting 'no version information available' message, I don't know does that have anything to do with the error.
git push origin master
git: /usr/local/lib/libz.so.1: no version information available (required by git)
Enter passphrase for key '/root/.ssh/id_rsa':
To git@[mydomain].beanstalkapp.com:/repo-git.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@[mydomain].beanstalkapp.com:/repo-git.git'
The error is that somebody else has pushed in the master
branch and you would overwrite their change if git
allowed you to push (this is what non-fast forward
error means). So you need to merge your local master
branch with the remote master
branch.
This can happen if you did the git pull
while the local branch was not the master
branch. If you only want to push the branch you are working on and not the master
branch, you need to tell it to git
using the complete form of git-push
:
$ git push remote local-branch:remote-branch
这篇关于Git:虽然我已经完成了git pull,但未能推送一些裁判的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!