如何在git中合并对其他人的项目的拉取请求? [英] How do I merge a pull request on someone else's project in git?

查看:279
本文介绍了如何在git中合并对其他人的项目的拉取请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在计算机上克隆了此存储库: https://github.com/derobins/wmd.git

虽然有几个错误,但似乎另一个用户已修复它们并发出拉出请求"(我想这些是要求更改的请求?)

是否可以将这些更改合并到我的本地版本中?

只是要清楚一点,这不是我的存储库.我正在使用来自derobins的WMD编辑器,但是它具有一些bug,这些pull请求旨在解决这些错误.我已经在Ubuntu(不在github中)上克隆了仓库,并希望在可能的情况下合并这些更改.

解决方案

(GitHub具有https://github.com/derobins/wmd.git

There are several bugs with it though, and it looks like another user has fixed them and issued "Pull requests" (I assume these are requests for their changes to be committed?)

Is it possible to merge those changes into my local version?

EDIT: just to be clear, this is not my repository. I am using the WMD editor from derobins, but it has several bugs which those pull requests purport to fix. I have cloned the repo on Ubuntu (not in github) and was hoping to merge those changes in if possible.

解决方案

(GitHub has very thorough documentation on how to deal with pull requests.)

Essentially, you'll want to add a remote for the repository of the person who made the pull requests, e.g.:

git remote add helpful git://github.com/helpful-person/whatever.git

... then fetch their changes into remote-tracking branches:

git fetch helpful

... so that now you have all the commits from that person's GitHub repository in your clone of the upstream repository. If you look at the additional commits within that pull request you could:

  1. merge the latest one, e.g. git merge 75708aeab5
  2. cherry pick each of those changes, e.g. git cherry-pick 2142db89, git cherry-pick 75708aeab5
  3. create a local branch to work on them further, e.g. git checkout -b fix-for-issue3 75708aeab5
  4. etc. etc.

An alternative is to just clone the repository of the contributor who made the pull requests instead, if that's the same but for those fixes.

这篇关于如何在git中合并对其他人的项目的拉取请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆