Git “fetch first”and ”non-fast-forward“ error when trying to push

转载请标明出处:http://blog.csdn.net/xx326664162/article/details/50016483 文章出自:薛瑄的博客

你也可以查看我的其他同类文章,也会让你有一定的收货!

一、”![rejected] master -> master (fetch first)”

这里写图片描述

解决办法:
执行命令 git fetch 拉取服务器上仓库

问题一的原因:
更新被拒绝,是因为本地库没有远程库的内容,通常是因为另外一个库push了相同的ref,你应该先合并远程库的改变,再次提交

Someone else (or you on some other machine) has pushed a changeset to the remote repository. You, on your local machine dont have those changes yet.

二、![rejected] master -> master (non-fast-forward)

这里写图片描述

解决办法:
执行命令”git pull origin master”

问题二原因:

本地的分支落后于远程的分支,需要先合并远程的改变,再push

I’ll provide an example and a picture to explain. Let’s assume your last pull from origin/branch was at Commit B. You have completed and committed some work (Commit C). At the same time, someone else has completed their work and pushed it to origin/branch (Commit D). There will need to be a merge between these two branches.

local branch:                         --- Commit C 
                                    /
                                   /
                                  /
origin/branch: Commit A ------ Commit B ---- Commit D

Because you are the one that wants to push, Git forces you to perform the merge. To do so, you must first pull the changes from origin/branch.

local branch:                     --- Commit C -- Commit E
                                   /               /           
                                  /               /             
                                 /               /               
origin/branch: Commit A ---- Commit B ---- Commit D 

After completing the merge, you will now be allowed to fast-forward origin/branch to Commit E by pushing your changes.

我认为上面这两个原因本质是一样的:
按道理说原因是一样的,解决一个就都解决了,但是这两个会都先后出现,求高人指点

参考 http://my.oschina.net/juwenz/blog/153350?fromerr=KEvNlIqT
http://stackoverflow.com/questions/25862329/git-giving-fetch-first-error-when-trying-to-push
http://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge

关注我的公众号,轻松了解和学习更多技术
这里写图片描述

展开阅读全文

Error while trying to retrieve text for error ORA-12514

04-02

[color=#FF0000]高手帮忙 调试执行如下:[/color]rnbash-3.1# proc ok.pcrnrnPro*C/C++: Release 10.2.0.1.0 - Production on Fri May 2 10:26:48 2008rnrnCopyright (c) 1982, 2005, Oracle. All rights reserved.rnrnSystem default option values taken from: /usr/local/ora//precomp/admin/pcscfg.cfgrnbash-3.1# gcc -o ok ok.c /usr/local/ora/lib/libclntsh.sornbash-3.1# ./okrnrn Error while trying to retrieve text for error ORA-12514rnrn[color=#FF0000]代码如下:[/color]rn#include "/usr/local/ora/precomp/public/sqlca.h"rnrn#ifndef ORA_PROCrnrn#include rn#include rn#include rnrn#endifrnrn void sql_error(char *msg) rn rn printf("\n%s %s\n", msg,(char *)sqlca.sqlerrm.sqlerrmc); rn EXEC SQL ROLLBACK RELEASE; rn exit(0);rn rnrnint main()rnrn EXEC SQL INCLUDE sqlca; rn EXEC ORACLE OPTION (RELEASE_CURSOR = YES); rn EXEC SQL WHENEVER SQLERROR DO sql_error(" ");rn EXEC SQL BEGIN DECLARE SECTION;rn char oraCN[50];rn char name[25];rn char id[3];rn EXEC SQL END DECLARE SECTION;rn memset(oraCN, 0, 50);rn strcpy(oraCN,"train22/train22@//192.168.135.227:1521/orcl;");rn rn /* oraCN.len = strlen(oraCN.arr);rn oraCN.arr[oraCN.len] = '\0';*/rn EXEC SQL CONNECT :oraCN;rn printf("Connect!\n");rn EXEC SQL DECLARE stu_cursor CURSOR FORrn SELECT bank_code,bank_name from par_bank WHERE IS_JW = 1;rn printf("DECLARE CURSOR OK!\n");rn EXEC SQL OPEN stu_cursor;rn if(sqlca.sqlcode == 0)rn rn printf("OPEN CURSOR OK!\n");rn rn else rn printf("open err![%d]", sqlca.sqlcode);rn rn rn while(1)rn rn EXEC SQL FETCH stu_cursor INTO :id,:name;rn if(sqlca.sqlcode != 0 && sqlca.sqlcode != 1403)rn rn printf("error!");rn rn else if (sqlca.sqlcode == 1403)rn rn break;rn rn rn printf("Id=%s Name=%s \n",id,name);rn rn EXEC SQL CLOSE stu_cursor;rn EXEC SQL COMMIT WORK RELEASE;rn printf("Disconnect!\n");rn return 0;rnrn 论坛

error while trying to flush writer

06-18

这个是07年的老问题了、百度基本没有类似的解决方法。rn请教!rn 本人正用spring2.0+webwork+hibernate3开发rn 现在想在原有基础上使用 oscache提高性能,使用中发现问题rn例如:rnrnrnrn其中 这个action功能是从数据库读取数据rnrn第一次执行该页的时候 出现异常:rn13:25:11,593 WARN [http-8080-Processor5] ActionComponent:122 - Error while trying to flush writer rnjava.io.IOException: Illegal to flush within a custom tagrnat javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:79)rnat com.opensymphony.webwork.components.ActionComponent.end(ActionComponent.java:120)rnat com.opensymphony.webwork.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:21)rnat org.apache.jsp.oscacheDemo_jsp._jspx_meth_ww_action_0(org.apache.jsp.oscacheDemo_jsp:232)rnat org.apache.jsp.oscacheDemo_jsp._jspx_meth_cache_cache_0(org.apache.jsp.oscacheDemo_jsp:178)rnat org.apache.jsp.oscacheDemo_jsp._jspService(org.apache.jsp.oscacheDemo_jsp:95)rnat org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnat org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rnat org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rnat org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rnat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rnat org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)rnat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)rnat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rnat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rnat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rnat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rnat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rnat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rnat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rnat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rnat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)rnat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)rnat org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rnat org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rnat org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rnat java.lang.Thread.run(Thread.java:595)rn但是数据一样能取出来rn在一分钟内 刷新该页面 cache包含的部分不再执行rnrn现在我的疑问是 这个异常怎么解决? 论坛

没有更多推荐了,返回首页