Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 287
Mike Robinson Avatar asked May 28 '15 23:05

Mike Robinson


People also ask

Why does git call it a pull request?

Pull requests are a feature specific to GitHub. They provide a simple, web-based way to submit your work (often called “patches”) to a project. It's called a pull request because you're asking the project to pull changes from your fork.

Can I git push without pulling?

You can do a forced push. The forced push will erase all commit history of the remote repository's branch, and replace it to your branch. Check the answers for doing forced pushes in "How do I properly force a Git push?".

What does create a pull request mean?

A pull request occurs when a developer asks for changes committed to an external repository to be considered for inclusion in a project's main repository. It is important to note that “pull requests” are a workflow method, and are not a feature of the version control system itself.

What happens when pull request is created?

A pull request – also referred to as a merge request – is an event that takes place in software development when a contributor/developer is ready to begin the process of merging new code changes with the main project repository.


1 Answers

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 
like image 123
TimWolla Avatar answered Oct 17 '22 05:10

TimWolla