Git 如何找到其他人';s pull请求(修复它)

Git 如何找到其他人';s pull请求(修复它),git,github,Git,Github,我们是一个程序员团队 我们有一个项目的主要回购协议 我们团队中的一名程序员向该回购协议发出了请求 我需要解决他的请求。我不是回购协议的主要所有者 我如何获取他的代码 当我去他的账户时,我看不到回购协议的分支(可能是私人的) 是这样做的吗 $ git remote add <name> <source> # for <source> - link to his pull request $ git fetch <name> $ git merge &

我们是一个程序员团队

我们有一个项目的主要回购协议

我们团队中的一名程序员向该回购协议发出了请求

我需要解决他的请求。我不是回购协议的主要所有者

我如何获取他的代码

当我去他的账户时,我看不到回购协议的分支(可能是私人的)

是这样做的吗

$ git remote add <name> <source> # for <source> - link to his pull request
$ git fetch <name>
$ git merge <name>/<branch>
$git remote add#for-链接到他的拉取请求
$git获取
$git合并/
  • 将远程指向添加到其他程序员回购/分支:

    git remote add ...
    
  • 创建他人的分支名称:

    git branch other_branch
    
  • 将分支更改为其他分支:

    git checkout other_branch
    
    注意:当然,您可以在单行中将该命令与上一个命令合并:

    git checkout -b other_branch
    
  • 拉其他源提交:

    git pull other_source other_branch
    
  • 修正他的密码

  • 添加和提交更改:

    git add
    git commit
    
  • 然后将更改推送到他的分支中,使其自动添加到pull请求中,然后接受请求

    如果访问未经授权,您必须在修复代码之前合并更改,然后将代码合并到主开发分支中,并将更改推送到repo中。但是,您需要取消拉取请求

  • 简单地


    (注意:在这种情况下,您显然无法将提交推送到pull请求)

    git pull${his_fork\u url\u here}huh在我的git上,您在
    git add remote
    之后指定分支作为参数,这比“top”答案更简单、更好
    git fetch origin pull/<pull-request-id>/head:<local-branch-name>
    git checkout <local-branch-name>
    
    git remote add upstream git@github.com:whoever/whatever.git
    git fetch upstream pull/<pull-request-id>/head:<local-branch-name>
    ...