拒绝的主人 - >主(非快进) [英] rejected master -> master (non-fast-forward)

查看:161
本文介绍了拒绝的主人 - >主(非快进)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图推动我的项目(所有文件在一个新的存储库中)。我按照步骤操作,但是当我用 git push -u origin master 推送时,我得到这个错误:

 ! [被拒绝] master  - > master(非快速转发)
错误:未能将某些文件推送到'git@github.com:asantoya / projectnewbies.git'
为了防止您丢失历史记录,非快进更新被拒绝
在再次按下之前合并远程更改(例如'git pull')。有关详细信息,请参阅git push --help的快速转发部分的
'注意事项。

真的很多次我得到这个错误,并且不知道该怎么做。

解决方案

git push 。显然,您的本地分支与您的跟踪分支不同步。



根据项目规则和工作流程,您可能也想使用 git pull - -rebase


I'm trying to push my project (all files in a new repository). I follow the steps but when I push with git push -u origin master I get this error:

! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:asantoya/projectnewbies.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.

really many times I got this error and can't figure out what to do.

解决方案

As the error message says: git pull before you try to git push. Apparently your local branch is out of sync with your tracking branch.

Depending on project rules and your workflow you might also want to use git pull --rebase.

这篇关于拒绝的主人 - >主(非快进)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆