Truth in IT
    • Sign In
    • Register
        • Videos
        • Channels
        • Pages
        • Galleries
        • News
        • Events
        • All
Truth in IT Truth in IT
  • Data Management ▼
    • Converged Infrastructure
    • DevOps
    • Networking
    • Storage
    • Virtualization
  • Cybersecurity ▼
    • Application Security
    • Backup & Recovery
    • Data Security
    • Identity & Access Management (IAM)
    • Zero Trust
    • Compliance & GRC
    • Endpoint Security
  • Cloud ▼
    • Hybrid Cloud
    • Private Cloud
    • Public Cloud
  • Webinar Library
  • TiPs
  • DRAW
  • CPE

Modify & Submit Stacked PRs with GitHub CLI

Github
10/13/2026
0 (0%)
Share
  • Comments
  • Download
  • Transcript
Report Like Favorite
  • Share/Embed
  • Email
Link
Embed

Transcript


you have to check out the extension for the GitHub CLI. I'm going to show you how I just used it. I just wrapped up some work. Originally, we had three layers in our stack, but then I noticed that there's one layer that doesn't make sense on its own. And that's the key when working with stacked PRs is you want to make sure your changes exist in a layer that makes sense within the context of that layer. So I'm going to use gh-stack-modify to fold changes into another layer to do some renaming, and then we'll use gh-stack-submit to get everything into our pull requests on github.com. And then we'll go ahead and merge one by one. I'm going to type in gh-stack-view. And here we can look at all of the layers that we have in our stack. If I hit the F key, I can see the files, right? We hit C, you can see the commits. In this stack, we created a slash community page for my LearnToCloud website. And we've made changes to the UI, to the metrics that are shown here. We have some curriculum updates and such. But from a reviewing context, there are a couple of changes I'd like to make. I'm going to type in gh-stack-modify now. The first thing I want to do is fold. So I'd like to fold this data model layer up into the page layer. So I'm going to make sure I'm on that. You can just use the arrows up and down. And then I'm going to hit the U key. And now we see it says pending one fold. This will fold up. So all of the work that I've done here is going to fold up here. Additionally, another change I want to do is rename this layer. I'm going to type in page-ui-updates. Fantastic. And now all I have to do to save all these changes is hit Control-S. Now we do gh-stack-view. And we see we have those modifications in place. In order to submit this, I will type in gh-stack-submit. And I will use auto and open, which will create the PRs and set them to open instead of draft. So I'll hit Enter. Great, so we can see everything was created there. Let's head over to github.com to review. So I'm in my pull requests tab and we see both of the PRs here and we see the stack icon as well. I'm going to click on 684. You can click on the stack map icon here to move across layers if you'd like. But I want to take a look down here and our CI that runs whenever we have something targeting main is currently running. So let's give this a moment to complete. Great, so all checks have passed. If I scroll down, I can see both of my layers in the stack. I'm going to do this bottoms up, of course, and I want to do this one by one. So I'm going to go ahead and squash and merge this one here. And what is going to happen now is that automatically our next layer is going to target main. So it's going to retarget, right? So I'm going to actually go in and click into this because it is now going to retarget to main. All the CI checks have to run here as well. So I'll have to wait for these to complete before I can merge them. Fantastic, and all checks have passed for this layer as well. I can go ahead, squash and merge. And there we go. All my work has been merged into main. So make sure you are using the extension for stacked PRs with the GitHub CLI. And just remember, there's so much flexibility in terms of how you want to merge, in terms of modifications you can make to your stacked PRs. There's an agent skill you can leverage in so much more. I'll make sure there is documentation linked somewhere so you can dive right in.

TL;DR

  • The GitHub CLI stacked PRs extension lets you inspect all layers of a stack using `gh stack view`, with keyboard shortcuts to browse files and commits per layer.
  • Use `gh stack modify` to fold redundant layers into adjacent ones and rename them, ensuring every PR layer is coherent and reviewable on its own.
  • `gh stack submit` opens all PRs on GitHub in a single command; merging bottom-up triggers automatic retargeting so each subsequent layer points to main.

Summary

This hands-on demo walks through the GitHub CLI extension for stacked pull requests, showing how to inspect, reorganize, and submit a multi-layer PR stack before merging into main. The presenter starts with a real-world scenario: a three-layer stack where one layer — a data model change — doesn't stand on its own as a meaningful, reviewable unit. Using `gh stack view`, developers can browse all layers in the stack, toggling between file diffs and commit history with simple keyboard shortcuts. The `gh stack modify` command then enables two key cleanup actions: folding a redundant layer up into an adjacent one, and renaming layers to better reflect their purpose. After saving changes with Control-S, `gh stack submit` opens the pull requests on GitHub with a single command, using the `--auto --open` flags to publish them as open PRs rather than drafts. On GitHub.com, the stack icon provides visual navigation across layers, and CI checks run automatically against each PR. Merging proceeds bottom-up — squash-merging the base layer triggers automatic retargeting of the next layer to main, so each subsequent PR is ready to merge once its CI checks pass. The workflow closes with a reminder that the extension supports flexible merge strategies and additional capabilities including an agent skill, with full documentation linked for deeper exploration.

Chapters

0:00 - Why Clean Up PR Layers?
0:40 - Inspecting with gh stack view
1:16 - Folding and Renaming Layers
2:14 - Submitting with gh stack submit
2:33 - Reviewing PRs on GitHub.com
3:21 - Auto-Retargeting and Final Merge
3:56 - Summary and Next Steps

Key Quotes

0:14 "That's the key when working with stacked PRs — you want to make sure your changes exist in a layer that makes sense within the context of that layer."
2:14 "In order to submit this, I will type in gh stack submit. And I will use auto and open, which will create the PRs and set them to open instead of draft."
3:23 "Automatically our next layer is going to target main. So it's going to retarget."
4:03 "There's so much flexibility in terms of how you want to merge, in terms of modifications you can make to your stacked PRs. There's an agent skill you can leverage and so much more."

FAQ

What does 'folding' a layer mean in the context of gh stack modify?

Folding merges the commits from one layer up into the layer above it, consolidating changes that don't stand alone as a meaningful unit into a more logical grouping before the PRs are submitted for review.

Do I need to manually retarget PRs after merging the first layer in a stack?

No — after squash-merging the base layer, GitHub automatically retargets the next PR in the stack to point at main, though CI checks will re-run on the retargeted PR before you can merge it.


Categories:
  • » Cybersecurity » Application Security
  • » Data Protection
Channels:
News:
Events:
Tags:
  • Demo
  • How-To
  • DevSecOps
  • Getting Started
  • Technical Deep Dive
  • Stacked Pull Requests
  • GitHub CLI
  • Code Review Workflow
  • Pull Request Management
  • Developer Productivity
  • Branch Management
  • CI
  • CD Integration
  • Git Workflow
Show more Show less

Browse videos

  • Related
  • Featured
  • By date
  • Most viewed
  • Top rated
  •  

              Video's comments: Modify & Submit Stacked PRs with GitHub CLI

              View CPE Certificates

              Upcoming 360 View Events

              • Nov
                19

                Securing the Microsoft Enterprise: Strengthening Configuration Management, Identity Security, and Data Protection

                11/19/202601:00 PM ET
                More events

                XStreaminars (watch here)

                • Nov
                  10

                  Zendesk: From AI Readiness to Results: A Framework for Transforming IT Service

                  11/10/202601:00 PM ET
                  • Nov
                    12

                    Leaving VMware Means Leaving vSAN: Your VMware Exit Is Really a Storage Decision

                    11/12/202601:00 PM ET
                    More events

                    Industry Events (Sponsor Hosted)

                    • Nov
                      10

                      Agentic Shopping Trends: Insights for the 2026 Holiday Season

                      11/10/202601:00 PM ET
                      • Nov
                        12

                        Practical Session: Connecting On-Prem Data to Databricks via MinIO AIStor (Americas)

                        11/12/202601:00 PM ET
                        • Nov
                          18

                          Hands-On Workshop: Connecting On-Prem Data to Databricks via MinIO AIStor (International)

                          11/18/202608:00 AM ET
                          • Nov
                            19

                            Zendesk Deep Dive: Get the work done faster with Employee Service AI Agents

                            11/19/202601:00 PM ET
                            • Nov
                              19

                              A Deep Dive into Muse, Dots, and Duet's Impact on Your Website

                              11/19/202601:00 PM ET
                              More events

                              Upcoming Webinar Calendar

                              • 11/10/2026
                                01:00 PM
                                11/10/2026
                                Zendesk: From AI Readiness to Results: A Framework for Transforming IT Service
                                https://www.truthinit.com/index.php/channel/2191/zendesk-from-ai-readiness-to-results-a-framework-for-transforming-it-service/
                              • 11/10/2026
                                01:00 PM
                                11/10/2026
                                Agentic Shopping Trends: Insights for the 2026 Holiday Season
                                https://www.truthinit.com/index.php/channel/2219/agentic-shopping-trends-insights-for-the-2026-holiday-season/
                              • 11/12/2026
                                01:00 PM
                                11/12/2026
                                Leaving VMware Means Leaving vSAN: Your VMware Exit Is Really a Storage Decision
                                https://www.truthinit.com/index.php/channel/2192/leaving-vmware-means-leaving-vsan-your-vmware-exit-is-really-a-storage-decision/
                              • 11/12/2026
                                01:00 PM
                                11/12/2026
                                Practical Session: Connecting On-Prem Data to Databricks via MinIO AIStor (Americas)
                                https://www.truthinit.com/index.php/channel/2202/practical-session-connecting-on-prem-data-to-databricks-via-minio-aistor-americas/
                              • 11/18/2026
                                08:00 AM
                                11/18/2026
                                Hands-On Workshop: Connecting On-Prem Data to Databricks via MinIO AIStor (International)
                                https://www.truthinit.com/index.php/channel/2194/hands-on-workshop-connecting-on-prem-data-to-databricks-via-minio-aistor-international/
                              • 11/19/2026
                                01:00 PM
                                11/19/2026
                                Securing the Microsoft Enterprise: Strengthening Configuration Management, Identity Security, and Data Protection
                                https://www.truthinit.com/index.php/channel/2076/securing-the-microsoft-enterprise-strengthening-configuration-management-identity-security-and-data-protection/
                              • 11/19/2026
                                01:00 PM
                                11/19/2026
                                Zendesk Deep Dive: Get the work done faster with Employee Service AI Agents
                                https://www.truthinit.com/index.php/channel/2181/zendesk-deep-dive-get-the-work-done-faster-with-employee-service-ai-agents/
                              • 11/19/2026
                                01:00 PM
                                11/19/2026
                                A Deep Dive into Muse, Dots, and Duet's Impact on Your Website
                                https://www.truthinit.com/index.php/channel/2228/a-deep-dive-into-muse-dots-and-duets-impact-on-your-website/
                              • 12/03/2026
                                01:00 PM
                                12/03/2026
                                CISO Insights: Steering Cybersecurity Strategies in an AI-Driven Era
                                https://www.truthinit.com/index.php/channel/2231/ciso-insights-steering-cybersecurity-strategies-in-an-ai-driven-era/
                              • 01/19/2027
                                02:00 PM
                                01/19/2027
                                HUMAN Dialogue: Embracing the Rise of the Empowered AI Consumer.
                                https://www.truthinit.com/index.php/channel/2160/human-dialogue-embracing-the-rise-of-the-empowered-ai-consumer/
                              Truth in IT
                              • Sponsor
                              • About Us
                              • Terms of Service
                              • Privacy Policy
                              • Contact Us
                              • Preference Management
                              Desktop version
                              Standard version