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

19,391

Solution 1

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:

[email protected]:~/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 [email protected]: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 [email protected]:stackoverflow.git
   4751391..01882eb  master -> master

Solution 2

I think TimWolla is right, but I just wanted to add this post from Atlassian, which clarifies Atlassian's policy:

In Stash 3.3, a feature was added to display a message to users in the terminal with a link to create a pull request when a new branch or branch with no pull requests is pushed. This guide will explain how to turn this feature off.

remote:
remote: Create pull request for ABC-123-fix-bug:
remote: http://localhost:7990/projects/PROJ/repos/REPO/compare/commits?sourceBranch=refs/heads/ABC-123-fix-bug
remote:

Currently this feature can only be turned on or off globally. [...]

To turn this feature off, do the following:

  1. Navigate to the 'Manage add-ons' section of the Stash admin screens
  2. Select 'System' from the dropdown
  3. Search for 'Bundled Hooks' expand it and its modules
  4. Find the 'print-branch-links-hook' module, click Disable

Solution 3

TimWolla provided the full explanation, but here is how to get it fixed in the long term: Provide your feedback on this support ticket to show that you share the frustration expressed by other users over this issue.

UPDATE: As of 2016-09-27 this is no longer an issue and Atlassian has provided an official response on the matter.

Here are the instructions for disabling these messages:

  1. Log into BitBucket with your browser.
  2. Click on your user icon on the top-right corner of the window.
  3. Go to BitBucket Settings
  4. Uncheck "Enable console messages."
  5. Press the "Update" button below.

Bitbucket Settings - Console Messages

Share:
19,391
Mike Robinson
Author by

Mike Robinson

Updated on June 06, 2022

Comments

  • Mike Robinson
    Mike Robinson about 2 years

    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)

  • Mike Robinson
    Mike Robinson about 9 years
    I know of no such "hooks" and can say with some certainty that "no one 'round here" has recently (or ever ...) built one. I don't really know what you mean by "make it easier for you to create a pull request," since I have no such desire nor intention. (This is 'my own, private, just to make sure I don't frobozz anything ...' branch.)
  • TimWolla
    TimWolla about 9 years
    @MikeRobinson This hook probably is a generic hook set up by BitBucket. You probably have no control over these.
  • jazzwhiz
    jazzwhiz about 9 years
    I saw this, but it doesn't work for bitbucket users. There is an "Add-on management" option under manage accounts, but none of the other listed options.
  • Mike Robinson
    Mike Robinson about 9 years
    It's okay... I see that it's a "fee-chur." Now that I understand where it's coming from, I know how to ignore it. :-)
  • ThatGuyRob
    ThatGuyRob over 5 years
    Is it possible to edit the URL they return? It would be nice to be able to include the destination branch "&dest=develop". Right now it auto defaults to master. It causes problems when devs forget to switch the destination to develop branch.
  • Chris Romkema
    Chris Romkema about 3 years
    Any suggestions what to do if you do not have this option in Bitbucket or if the user is not one which you can login to Bitbucket with (jenkins user)?