Paul
Paul

Reputation: 4430

Bash git list of still open pr

Is there a command in bash using git that allows me given a repository, know all the pr that are open there?

For example, he finds me more open than those who actually exist.

Command:

git ls-remote https://github.com/CodeEditApp/CodeEdit "refs/pull/*/merge"

Result:

533479b407dc603fb8ad595e6688834431798dc2    refs/pull/1169/merge
08ad7a8157f1674328c91e52aac4353dce18a529    refs/pull/118/merge
641b0f15fada81e2f3630b4d398619ef019483d7    refs/pull/1283/merge
cc898565328db7c01b17a517a1cfcc281a0feaa4    refs/pull/1518/merge
c5b9937c302c2e12fb8d1299134107fa2fb95eba    refs/pull/1535/merge
cc2134231e38f8251f92a5c6225281708e3929c4    refs/pull/1564/merge
57ccf0f6f77675b4b29461fa5983d8bb502ab5cf    refs/pull/1581/merge
9f97254a83da70dded4951388c36533e3cfead4b    refs/pull/1582/merge
be8793adca5b0861499a944c09d7d2a4d7980395    refs/pull/237/merge
cc9103172621536c937f8b695598ccc5bcead1ce    refs/pull/25/merge
c97bf39388db2d5c2158b66944a1728eb6cef536    refs/pull/591/merge
1a99d22ef33478549468e35ae3c195cbf65054d3    refs/pull/673/merge
7118573f296045228c1993a25ea5156faf92c29b    refs/pull/690/merge

Can you give me a hand?

Upvotes: 0

Views: 107

Answers (1)

Jim Redmond
Jim Redmond

Reputation: 5631

Pull requests are not a native concept in Git, so there's no built-in way to do this.

Since you've tagged this question with GitHub, though, the gh command-line tool (https://cli.github.com/) has this function already: gh pr list --state open will return a list of the ID, title, source branch, and relative creation date of all open PRs in a given repo.

Upvotes: 2

Related Questions