简体   繁体   中英

GIT Commit Message for a PR

Is there any git Command to get the commit message for a specific PR.

git log gives me the complete history, but I have a PR and wanted to list all the commit message for the PR.

A PR has nothing to do with git , really; that's something that GitHub has created to ease the process of collaborating with others. That means that the git command itself doesn't know anything about pull requests.

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. 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.


You can install GitHub's own gh cli , which will let you do things like:

gh pr list

There is another CLI for GitHub called hub that when installed properly will let you run:

git pr list

Both tools will let you check out a pr locally so that you can examine the commits that it includes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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