尝试推送到服务器时,在NetBeans中获取REJECTED_NONFASTFORWARD [英] Getting REJECTED_NONFASTFORWARD in netbeans when trying to push to server

查看:121
本文介绍了尝试推送到服务器时,在NetBeans中获取REJECTED_NONFASTFORWARD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在bitbucket上有一个存储库,我想将其导入到我在实时共享主机上创建的.git文件夹中网络服务器(我已经安装了git)。我可以通过SSH提供命令。我遵循 http://joemaller.com/990/a-web-focused-git中的说明-workflow /



我已经能够在文章中描述的服务器上设置2个仓库。我也有post update和post commit hook。我试图通过推送更新到服务器来测试系统。我正在使用netbeans 7.3 beta git支持。但是,当给出命令:

  push(在netbeans中)到ssh://****.com/home/* ***** / site_hub.git 

输出结果为:

  == [IDE] == 2012年11月19日下午10:28:15推送
git push ssh://***.com/ home / *** / site_hub.git + refs / heads / master:refs / heads / master
存储库更新
分支:master
旧ID:0121897bdd7cf3caad9e18717fc27a7a08 ***
New Id:837c194c70fb41dc7de3be7841c946ca ***
结果:REJECTED_NONFASTFORWARD

本地存储库更新
无更新
== [IDE] == 2012年11月19日上午10时28分18秒下午推完了。

如何解决这个问题?

解决方案

非快速推送意味着您尝试推送的分支与当前分支所在的分支不同。换句话说,您的远程中有一些新的提交需要合并才能推送。



要实现这一点,您可以 git pull 为了合并两个分支,然后推送结果,或者可以执行 git fetch ,然后执行 git rebase origin / master (或者任何你放入远程和HEAD分支的名字),这样你的提交就应用在远程分支的顶部。然后你可以推动结果,这将是一个快速前进。


I am a new git user.

I have a repository on bitbucket that I would like to import into a .git folder I have created on my live shared host web server ( where I have git installed ). I can give commands via SSH. I am following the instructions in http://joemaller.com/990/a-web-focused-git-workflow/

I have been able to set up the 2 repos on the server as described in the article. I also have the post update and post commit hooks in place. I am trying to test the system by pushing an update to the server. I am using netbeans 7.3 beta git support. However when give the command:

push ( in netbeans ) to ssh://****.com/home/******/site_hub.git

The output is:

==[IDE]== Nov 19, 2012 10:28:15 PM Pushing
git push ssh://***.com/home/***/site_hub.git +refs/heads/master:refs/heads/master
Repository Updates
Branch : master
Old Id : 0121897bdd7cf3caad9e18717fc27a7a08***
New Id : 837c194c70fb41dc7de3be7841c946ca***
Result : REJECTED_NONFASTFORWARD

Local Repository Updates
No update
==[IDE]== Nov 19, 2012 10:28:18 PM Pushing finished.

How can I fix this?

解决方案

A non-fastforward push means the branch your are trying to push to diverged from the point your current branch is. In other words, there are new commits in your remote that you have to merge with to be able to push.

To achieve this, you can git pull in order to merge both branches, and then push the result, or you can do a git fetch and then a git rebase origin/master (or whatever names you put to your remote and HEAD branch) so your commits are applied on top of the remote branch. Then you can push the result, and that would be a fast-forward.

这篇关于尝试推送到服务器时,在NetBeans中获取REJECTED_NONFASTFORWARD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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