How to send pull request on Git

Both Git (the software) and GitHub (the web service) have a concept called “pull request”, and unfortunately they are not exactly the same thing.

Native Git

The native Git request-pull command has a very short manual page with the following one-sentence description:

Summarizes the changes between two commits to the standard output, and includes the given URL in the generated summary.

This is a fairly low-level command that generates a short summary of changes that is suitable for posting to a mailing list. Other users can use the URL published in this “pull request” to manually pull changes into their own repository.

GitHub Pull Requests

When using the GitHub web service, a Pull Request is a full-featured interactive collaboration tool. A GitHub pull request has:

  • a more detailed description of the changes than just the individual commit summaries
  • notifications automatically sent to users who have chosen to watch the project
  • an online review interface where others can comment on proposed changes
  • discussion comments for recording conversations about commits
  • central management of pull requests so they won’t get lost

It is worth noting that Linus has his own opinion on the relative utility of these two features.

Conclusion

The two “pull request” features described above are similar in spirit but completely different in implementation. In particular, the git request-pull command cannot be used to create a new Pull Request on GitHub. You have several choices if you want to support “pull request” type functionality:

  • Use GitHub. This definitely involves the least effort, but if your project is not public you’ll have to pay GitHub to host a private repository. Some people might not be comfortable with this choice.
  • Use Gerrit. Gerrit is an open-source server program you can download that provides many features similar to those available in GitHub. It is especially well suited to collaborative code reviews.
  • Use git request-pull and a mailing list. Using this method requires a lot more discipline from your engineers, as it’s easy to misplace or mishandle mailing list messages. There is no central accountability associated with this method.

Leave a Comment