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

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

问题描述

我是一个新的 git 用户.

I am a new git user.

我在 bitbucket 上有一个存储库,我想将其导入到我在实时共享主机 Web 服务器上创建的 .git 文件夹中(我安装了 git).我可以通过 SSH 发出命令.我正在按照 http://joemaller.com/990/a-web-focused-git 中的说明进行操作-工作流程/

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/

我已经能够按照文章中的描述在服务器上设置 2 个存储库.我也有 post update 和 post commit hooks.我正在尝试通过向服务器推送更新来测试系统.我正在使用 netbeans 7.3 beta git 支持.但是当给出命令时:

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

输出为:

==[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.

为了实现这一点,你可以git pull来合并两个分支,然后推送结果,或者你可以先做一个git fetch然后一个git rebase origin/master(或您放置到远程和 HEAD 分支的任何名称),以便您的提交应用于远程分支之上.然后你可以推送结果,这将是一个快进.

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天全站免登陆