Egit拒绝不快(Egit rejected non-fast-forward)
我在推送到github仓库时收到这个消息。 你能告诉我一步一步的程序来解决它吗? 我只推了一次,成功了。 但是,当我更新一个项目并试图推动我的第二个提交时,它显示“主人拒绝非快进”,不允许我推。 请说明程序。
I am getting this message while pushing to github repository. Can you tell me step by step procedure to fix it? I pushed only once and it was successful. But, when I updated a project and tried to push my second commit, it shows "master rejected non-fast-forward" and does not allow me to push. Please explain the procedure.
原文:https://stackoverflow.com/questions/19474186
更新时间:2022-04-30 17:04
最满意答案
相关问答
更多-
它是一个模板。 http://en.wikipedia.org/wiki/Template_%28programming%29 Its a template. http://en.wikipedia.org/wiki/Template_%28programming%29
-
你不能做一个全局查找/替换,因为你可以复制一个auto_ptr (具有已知的后果),但唯一的unique_ptr只能被移动。 任何看起来像 std::auto_ptr
p(new int); std::auto_ptr p2 = p; 将至少要这样做 std::unique_ptr p(new int); std::unique_ptr p2 = std::move(p); 对于其他差异, unique_ptr可以正确处理数组(它将调用delete[] ,而au ... -
在你的情况下使用矢量是最安全的选择: std::vector
data(123); processData的签名理想情况下应该是: void processData(const std::vector & data); 但是,这个更常用: void processData(uint32 * bytes, int length); 在这两种情况下,您都可以使用该矢量: // 1 processData(data); // 2 processData(data.data( ... -
由于异常跟踪表明你的conn对象为null,因此调用它上面的任何方法都会导致NullPointerException 。 您需要在初始化conn对象的位置检查代码以正确初始化它。 此外,最好还是进行空检查以避免空指针异常。 As the exception trace says your conn object is null and hence calling any method on it will cause NullPointerException. You need to check your ...
-
如果指定的auto_ptr已经存在指针,则必须首先删除该指针。 从2003年标准(§20.4.5.1): auto_ptr& operator=(auto_ptr& a) throw(); 7要求:表达式delete get()格式正确。 8效果: reset(a.release()) 。 9返回: *this 。 因此,分配给auto_ptr与使用从右侧auto_ptr释放的指针调用reset相同的效果。 你引用的网站是错误的。 If the auto_ptr being assigned to alr ...
-
为什么不允许auto_ptr使用赋值语法进行初始化(Why auto_ptr initialization using the assignment syntax is not allowed)[2023-06-22]
赋值语法不能用于从原始指针初始化auto_ptr这一事实是构造函数的一个副作用,它将原始指针标记为显式。 将构造函数标记为显式的通常原因是为了防止这样的事情发生: void take_ownership(std::auto_ptrptr) { // the pointer is deleted when this function ends } void foo() { ClassA obj; take_ownership(&obj); // oops, dele ... -
std :: auto_ptr
用法(std::auto_ptr [2023-08-03]Usage) 我会给你一个很好的例子。 考虑这个: auto_ptrsome_function() { auto_ptr my_ptr = get_the_resource(); function_that_throws_an_exception(); return my_ptr; } 引发异常的函数通常会导致指针丢失,并且指向的对象不会被删除。 对于auto_ptr ,这是不可能发生的,因为如果它没有被赋值(例如return ),它 ... -
unique_ptr强制您明确转移所有权,因此它在代码中可见并且清晰。 有了auto_ptr ,就很容易获得所有权的安全转移,并且在阅读代码时,并不总是清楚所有权是否被转移,如果是,它是否是代码作者的意图或是错误! 当你看到一个与std::move一起使用的unique_ptr ,显然意图是转移所有权。 unique_ptr正确支持移动语义,所以它只允许从临时对象和移动对象(即右值 )进行所有权转移。 容器可以检测一个类型是否“移动感知”并采取适当的行动。 auto_ptr不知道移动语义,并将所有权从左值或 ...
-
我认为已经产生了足够的讨论以保证另一个答案。 首先,回答实际问题,是的,当所有权转移发生时,通过智能指针传递参数是绝对合适的(甚至是必要的!)。 通过智能指针传递是一种常见的成语。 void manage(std::auto_ptr
t) { ... } ... // The reader of this code clearly sees ownership transfer. std::auto_ptr t(new T); manage(t); 现在,所有智能指针都有明确的构造函 ... -
您的侦听器类不应该扩展HttpServlet,因为它不是servlet,而只是ServletContextListener。 因此,它应该使用@WebListener进行注释,而不是使用@WebServlet进行注释。 也就是说,你不应该在你的webapp中使用单个数据库连接,因为很明显,如果同时处理两个请求,两者都将使用相同的连接,因此无法正确地进行事务处理。 阅读servlet容器的文档,了解如何正确创建DataSource并从servlet访问它(有关Tomcat,请参阅http://tomcat.a ...