开发者

JohnDoe wants someone to pull from johndoe:master:

I have no much experience with git or github and today I got a mail requesting someone (me) to pull the master branch.

Could someone lead me on the steps I should take to do this? I always work with individual projects so I have never merged of pulled something

Thanks in advan开发者_高级运维ce


Help.GitHub: Sending pull requests gives the following procedure for merging in a pull request:

Merging a Pull Request

Once the pull request is deemed satisfactory, someone with push access to the destination repository must apply the changes and push the updated branch. There are a variety of ways to accomplish this. Two popular methods are described below.

Fetch and Merge

This is the most common method of fetching and applying changes. It requires adding a remote for the person that sent the pull request, fetching from that repository, merging the requested branch, fixing any conflicts, and pushing the newly merged branch back to the repository:

$ git checkout master
$ git remote add kneath git://github.com/kneath/jobs.git
$ git fetch kneath
$ git merge kneath/error-page
$ git push origin master

Patch and Apply

The fetch and merge approach works great when you’re working on a team or repeatedly applying changes from the same small group of people. Another approach that’s a bit quicker in one-off cases is to use git-am.

Every pull request has a .patch URL where you can grab a textual patch file to feed into the git-am command:

$ git checkout master
$ curl http://github.com/github/jobs/pull/25.patch | git am
$ git push origin master

For further detail, check the linked pages below.

See also:

  • Help.GitHub: Sending pull requests
  • I Have a Pull Request on GitHub, Now What?
  • How to Handle a Pull Request from GitHub
  • git-pulls: Manage GitHub pull requests from the command line
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜