CARVIEW |
ATTN: Rackspace Move Scheduled for Sunday, September 27th at 5PM Pacific Time. Learn More.
Guides: Pull Requests
Pull requests are a way to poke someone and let them know you’ve got some code they may want.
They work great when you want to let an upstream maintainer know that you’ve pushed some useful changes to your fork of their project.
They also work great if you want to let a fellow developer know that you’ve pushed some experimental features to an arbitrary branch.
Step One
First, navigate to your project with the changes you want someone else to pull. In this instance, I’m going to go to defunkt/grit and tell mojombo to pull a change.
Step Two
I can type in a message if I want and select any number of recipients. By default, I’ll see everyone who has a project in my project’s network. If I want to add someone else, I can use the autocompleter and click ‘add.’
Step Three
Sent!
Step Four
When mojombo logs in, he’ll see that there’s a new message waiting for him.
Step Five
mojombo can reply to my message, delete it, or ignore it. Pulling from me is easy. mojombo can add the defunkt repository as a remote source, create a new branch, and pull the defunkt repository contents into it like this:
$ git remote add -f defunkt git://github.com/defunkt/grit.git $ git checkout -b defunkt/master $ git pull defunkt master:4f0ea0c
Note that to pull from a private repository, you need to use the private update URL. If grit were private for example, the remote add would look like, “git@github.com:defunkt/grit.git”.
$ git checkout master $ git merge defunkt/master $ git push
Once the changes are pulled, the branch they were pulled into should be merged with the master branch and pushed.
(I suppose, git commit is needed before checking out master branch. It seems obvious, but…)