当我“推动” git现在说“Create pull request for ...”。为什么? [英] When I "git push" git now says "Create pull request for ...". Why?

查看:571
本文介绍了当我“推动” git现在说“Create pull request for ...”。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在修改一个分支中的项目,到目前为止,除了我之外,其他人都知道这个项目。然而,从最近开始,当我 git push 到这个项目时,我现在收到了这个响应: p $ p> remote:为<<<< my branch>>创建拉取请求:
remote:https://bitbucket.org / ...

我不知道为什么Git会给我这个消息,这是我从未见过的。



即使我删除远程分支(使用 git push origin:<<< my branch>>< / code>我现在仍然得到这个消息!(我成功地删除了在远程的分支,但消息仍然)

解决方案

注意:现在可以禁用这些消息。请参阅杰克的回答



前缀为 remote:的所有内容都有已由在服务器上接收脚本 1 。 Bitbucket可能希望让你更容易创建一个请求。






1 示例这样的 post-receive 钩子使用 echo 来发送消息给用户,正如上面的链接所述。一旦所有推送的数据完全保存在服务器上,它将被调用:


标准输出和标准错误输出都被转发到git send -pack在另一端,所以你可以简单地为用户回显消息。


在服务器上:

  git@example.com:〜/ stackoverflow.git / hooks $ cat post-receive 
#!/ bin / bash

echo这是一个在服务器上运行的git钩子的例子

客户端:

  $ git push git@example.com:stackoverflow.git master:master 
计数对象:1,完成。
写入对象:100%(1/1),187字节| 0字节/秒,完成。
合计1(delta 0),重用0(delta 0)
remote:这是一个在服务器
上运行的git钩子的示例git@example.com:stackoverflow.git
4751391..01882eb master - >主


I am making changes to a project in a branch that, so far, is known to no one else but me. However, starting recently, when I git push to this project, I now receive this as part of the response:

remote: Create pull request for <<my branch>>:
remote:   https://bitbucket.org/...

I have no idea why Git is giving me this message, which I have never seen before.

Even if I delete the remote branch (with "git push origin :<<my branch>>" I now still get this message! (I successfully deleted the branch on the remote, but the message remains)

解决方案

Note: These messages can be disabled now. See Jake's answer. Read along my answer for the technical explanation.

Everything that is prefixed by remote: has been sent by the receiving script1 on the server. Bitbucket probably wants to make it easier for you to create a pull request.


1 Example of such a post-receive hook using echo to send a message to the user as explained in the link above. It will be called once all the pushed data is completely saved on the server:

Both standard output and standard error output are forwarded to git send-pack on the other end, so you can simply echo messages for the user.

On the server:

git@example.com:~/stackoverflow.git/hooks$ cat post-receive 
#!/bin/bash

echo "This is an example of a git hook running at the server"

On the client:

$ git push git@example.com:stackoverflow.git master:master
Counting objects: 1, done.
Writing objects: 100% (1/1), 187 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: This is an example of a git hook running at the server
To git@example.com:stackoverflow.git
   4751391..01882eb  master -> master

这篇关于当我“推动” git现在说“Create pull request for ...”。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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