简体   繁体   English

确定包含来自(功能)分支的拉取请求

[英]determine containing pull request from (feature) branch

Is it possible to determine the pull request containing a given branch from command line?是否可以从命令行确定包含给定分支的拉取请求

I have checked out feature-whatever branch.我已经检查了feature-whatever分支。 It is part of PR #83 (which I can verify via github webbrowser), but I would like to determine this它是 PR #83 的一部分(我可以通过 github 网络浏览器进行验证),但我想确定这一点

  • from the cloned git repo来自克隆的 git 存储库
  • via command line通过命令行
$ git status
On branch feature-whatever
Your branch is up to date with 'origin/feature-whatever'.
...

$ git branch -r
  origin/HEAD -> origin/develop
  origin/PR-82
  origin/PR-83
  origin/develop
  origin/feature/feature-whatever
  origin/feature/feature-something-else
  origin/main

There may be more than one GitHub pull request that contains any given commit.可能有多个包含任何给定提交的 GitHub 拉取请求。

Given your own git branch -r output, you want a simple --contains :给定您自己的git branch -r output,您需要一个简单的--contains

git branch -r --contains feature-whatever

This should list origin/PR-83 in your case.在您的情况下,这应该列出origin/PR-83 Note that I assume you created origin/PR-83 from GitHub's refs/pull/83/head name, perhaps with git fetch origin +refs/pull/83/head:refs/heads/PR-83 .请注意,我假设您从 GitHub 的refs/pull/83/head名称创建了origin/PR-83 ,可能使用git fetch origin +refs/pull/83/head:refs/heads/PR-83

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从功能分支的拉取请求中删除以前的合并和提交? - How to remove previous merges and commits from the pull request on a feature branch? Git:从另一个功能分支接受拉取请求 - Git: Taking pull request from another feature branch 在合并我的拉取请求之前,我可以将更新从发布分支拉到我的功能分支吗? - Before merging my pull request can I pull update from release Branch to my feature branch? 从开发分支拉到Smartgit中的功能分支 - Pull from develop branch to feature branch in Smartgit 合并拉取请求后,如何防止来自功能分支的提交出现在开发分支中? - How to prevent commits from a feature branch from showing up in the dev branch after the pull request is merged? Github:提交拉取请求后将 `master` 分支合并到 `feature` 分支 - Github: Merge `master` branch into `feature` branch after submiting pull request 将更改从分支开发拉到我的功能 - Pull changes from branch develop to my feature 从master的dev和feature分支中提取 - taking pull from dev and feature branch in master 如何从拉取请求的功能分支中删除特定于操作系统的提交? - How to remove OS-specific commits from feature branch for pull request? 在功能分支中合并和还原的拉取请求可防止重新合并它 - Pull Request merged and reverted in feature-branch prevents from re-merging it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM