我想检查之前创建的拉请求(通过GitHub web界面创建)。我搜索了一下,发现不同的地方有裁判/拉或裁判/拉/pr
但是当我添加fetch = +refs/pull/*/head:refs/remotes/origin/pr/*到git配置文件并进行git取回时
我哪里做错了?GitHub应该自动创建拉/xyz东西,还是我必须配置一些东西?
我想检查之前创建的拉请求(通过GitHub web界面创建)。我搜索了一下,发现不同的地方有裁判/拉或裁判/拉/pr
但是当我添加fetch = +refs/pull/*/head:refs/remotes/origin/pr/*到git配置文件并进行git取回时
我哪里做错了?GitHub应该自动创建拉/xyz东西,还是我必须配置一些东西?
当前回答
对于Bitbucket,你需要将pull替换为pull-requests。
首先,你可以通过git ls-remote origin命令确认pull request URL样式。
$ git ls-remote origin |grep pull
f3f40f2ca9509368c959b0b13729dc0ae2fbf2ae refs/pull-requests/1503/from
da4666bd91eabcc6f2c214e0bbd99d543d94767e refs/pull-requests/1503/merge
...
正如你所看到的,它是refs/pull-requests/1503/from而不是refs/pull/1503/from
然后你可以使用任何答案的命令。
其他回答
如果你使用Github.com,转到“拉请求”,点击相关的拉请求,然后点击“命令行说明”链接:
将远程公关分支机构导入本地分支机构:
Git获取来源' remote_branch ': ' local_branch_name '
配置本地分支的上游为远端分支。
git分支——set-upstream-to=origin/PR_Branch_Name local_branch
当您想再次将本地更改推到PR分支时
git push origin HEAD:remote_PR_Branch_name
对于Bitbucket,你需要将pull替换为pull-requests。
首先,你可以通过git ls-remote origin命令确认pull request URL样式。
$ git ls-remote origin |grep pull
f3f40f2ca9509368c959b0b13729dc0ae2fbf2ae refs/pull-requests/1503/from
da4666bd91eabcc6f2c214e0bbd99d543d94767e refs/pull-requests/1503/merge
...
正如你所看到的,它是refs/pull-requests/1503/from而不是refs/pull/1503/from
然后你可以使用任何答案的命令。
假设你的起源和上游信息如下所示
$ git remote -v
origin git@github.com:<yourname>/<repo_name>.git (fetch)
origin git@github.com:<yourname>/<repo_name>.git (push)
upstream git@github.com:<repo_owner>/<repo_name>.git (fetch)
upstream git@github.com:<repo_owner>/<repo_name>.git (push)
分行的名字是
<repo_owner>:<BranchName>
then
git pull origin <BranchName>
应该做这项工作
签出PR并查看与VSCode中的主分支相比PR的所有更改。类似文件更改部分Github的PR页面。
checkout PR(100)在“分离HEAD”状态 git fetch origin pull/100/head && git checkout FETCH_HEAD 显示为未提交的更改 Git重置主机 切换回主分支并执行这些更改 Git开关-