• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)
You are here: Home / Archives for bash script

bash script

Get GitHub PR Number from Current Branch

Last updated on June 3, 2025 by Sal Ferrarello

When scripting a task using the GitHub CLI, I found I needed the Pull Request (PR) number for my current branch (technically my current commit). I was able to use “gh pr view” to get the information.

Filed Under: Computing, Dev Tips, Solution Tagged With: bash script, command line, GitHub, GitHub CLI

Copyright © 2026 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in