Skip to main content
 首页 » 编程设计

GitHub之错误 : failed to push some refs to 'git@github.com:myrepo.git'

2024年09月07日11leader

我收到以下错误。我该如何解决?:
git 添加。
git commit -m 't'
git push 原点开发

To git@github.com:myrepo.git 
 ! [rejected]        development -> development (non-fast-forward) 
error: failed to push some refs to 'git@github.com:myrepo.git' 
To prevent you from losing history, non-fast-forward updates were rejected 
Merge the remote changes (e.g. 'git pull') before pushing again.  See the 
'Note about fast-forwards' section of 'git push --help' for details. 

请您参考如下方法:

您的原始存储库领先于您的本地存储库。在推送之前,您需要按如下方式从源存储库中提取更改。这可以在您的提交和推送之间执行。

git pull origin development 
development指的是您要从中拉出的分支。
如果你想从 master 拉分支然后输入这个。
git pull origin master