github如何接受别人的邀请,我如何查看GitHub拉取请求?

博客围绕在GitHub上拉取远程PR到本地仓库展开。用户尝试在git配置文件添加fetch配置后进行git fetch操作未达预期,询问问题所在。解决方案是使用git fetch origin pull/ID/head:BRANCHNAME命令拉取,ID为PR编号,BRANCHNAME为新分支名,创建分支后用git checkout切换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I'd like to check out a previously created pull request (created via GitHub web interface). I searched and found different places where a refs/pull or refs/pull/pr

But when I add fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to the git config file and do a git fetch

What I'm doing wrong? Should GitHub create automatically the pull/xyz stuff, or do I have to configure something?

解决方案

To fetch a remote PR into your local repo,

git fetch origin pull/ID/head:BRANCHNAME

where ID is the pull request id and branchname is the name of the new branch that you want to create. Once you have created the branch, then simply

git checkout BRANCHNAME

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值