简体   繁体   English

PR 的 GIT 提交消息

[英]GIT Commit Message for a PR

Is there any git Command to get the commit message for a specific PR.是否有任何 git 命令来获取特定 PR 的提交消息。

git log gives me the complete history, but I have a PR and wanted to list all the commit message for the PR. git log给了我完整的历史记录,但我有一个 PR 并想列出 PR 的所有提交消息。

A PR has nothing to do with git , really; PR 与git无关,真的; that's something that GitHub has created to ease the process of collaborating with others.这是 GitHub 为简化与他人协作过程而创建的东西。 That means that the git command itself doesn't know anything about pull requests.这意味着git命令本身对拉取请求一无所知。

You have a few options if you want to interact with pull requests on the command line.如果您想在命令行上与拉取请求进行交互,您有几个选择。

GitHub provides instructions for checking out a pull request locally. GitHub 提供了在本地检出拉取请求的说明。 You can run something like:您可以运行以下内容:

git fetch origin pull/123/head:my-interesting-pr

And then:进而:

git checkout my-interesting-pr

That's fine for individual PRs, but it doesn't allow you to list existing pull requests, create new ones, or otherwise interact with GitHub pull requests or issues.这对个人 PR 来说没问题,但它不允许您列出现有拉取请求、创建新拉取请求或以其他方式与 GitHub 拉取请求或问题进行交互。


You can install GitHub's own gh cli , which will let you do things like:您可以安装 GitHub 自己的gh cli ,它可以让您执行以下操作:

gh pr list

There is another CLI for GitHub called hub that when installed properly will let you run: GitHub 的另一个 CLI 称为hub ,正确安装后可以运行:

git pr list

Both tools will let you check out a pr locally so that you can examine the commits that it includes.这两种工具都可以让您在本地检查 pr,以便您可以检查它包含的提交。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM