简体   繁体   English

无法在Amazon EC2服务器上使用Netbeans和GIT推送

[英]Cannot push with Netbeans and GIT on Amazon EC2 Server

I'm pretty new on UNIX/GIT world. 我在UNIX / GIT领域还很新。

I'm trying to setup a GIT repo on a Amazon EC2 Machine so I can work on my projects from different places with ease. 我正在尝试在Amazon EC2机器上设置GIT存储库,以便可以轻松地在不同地方处理我的项目。

After some hours of work some things are ok, I managed to connect to the repo with my IDE (Netbeans) and clone the remote content. 经过几个小时的工作,一切正常,我设法用我的IDE(Netbeans)连接到仓库,并克隆了远程内容。

The problem start when I try to push something to the remote repo, Netbeans give me an error and this output, with a generic error: 当我尝试将某些内容推送到远程仓库时,问题就开始了,Netbeans给我一个错误,并且此输出出现一般错误:

==[IDE]== 4-lug-2012 15.34.59 Pushing
git push ec2-xxx-xxx-xxx-xxx.eu-west-1.compute.amazonaws.com:/var/www/myDir/        +refs/heads/master:refs/heads/master
Remote Repository Updates
Branch : master
Old Id : 84c3fb34b54b501b52c914eca123d4d850688e26
New Id : 7e7fd752d2cde7b0bf8824eef83c535ee2418508
Result : REJECTED_OTHER_REASON

Local Repository Updates
Branch : origin/master
Old Id : 84c3fb34b54b501b52c914eca123d4d850688e26
New Id : 7e7fd752d2cde7b0bf8824eef83c535ee2418508
Result : NOT_ATTEMPTED

==[IDE]== 4-lug-2012 15.35.02 Pushing finished.

I've read around about make the remote depo "bare", the git push succeed in this case but the file isn't updated anyway... what I'm missing? 我已经读过有关使远程depo“裸露”的信息,在这种情况下git push成功了,但是文件仍然没有更新……我所缺少的是什么?

Thanks for the help! 谢谢您的帮助!

Is your EC2 instance also where your code is used for production? 您的代码也用于生产的EC2实例吗? If so, then you'll need a bare repository on your EC2 instance to handle the commits and another git clone (of the bare repository) to provide your production code. 如果是这样,那么您将需要在EC2实例上有一个裸存储库来处理提交,并需要另一个(裸存储库的)git克隆来提供您的生产代码。

Work flow: 工作流程:

  1. Set-up a bare repository on your EC2 instaance. 在您的EC2实例上建立一个裸仓库。
  2. Clone this for your production code* 将此复制为您的生产代码*
  3. Clone this new repository to your local machine* 将此新存储库克隆到本地计算机*
  4. Code, Commit, Push. 代码,提交,推送。 Repeat. 重复。
  5. Configure a post-receive hook to automatically update your production (eg, pull) 配置接收后挂钩以自动更新您的作品(例如,拉动)

*Obviously you don't want the pull to update your production with HEAD/master - so ensure that you've got a branch/tag for production or for development. *显然,您不希望该功能使用HEAD / master更新您的产品-因此请确保您具有用于生产或开发的分支/标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM