Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
531 views
in Technique[技术] by (71.8m points)

bitbucket - When I "git push" git now says "Create pull request for ...". Why?

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)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...