In April 2025, GitHub announced an update to its Command Line Interface (CLI), introducing enhanced support for triangular workflows – a common pattern among open-source contributors who work with forked repositories.
Triangular workflows involve three key components: the original repository (upstream), a personal fork (origin), and the local development environment. Developers typically clone their fork, set the upstream remote to the original repository, and configure their Git settings to pull updates from upstream while pushing changes to their fork. This setup allows contributors to stay synchronized with the main project while working independently.
Prior to this update, the GitHub CLI’s gh pr commands did not fully align with Git’s handling of such configurations, resulting in challenges with managing pull requests within triangular workflows. The latest enhancement ensures that the CLI respects Git’s push and pull configurations, allowing for seamless creation and management of pull requests from a fork to the upstream repository.
This improvement has been well-received by the developer community. On LinkedIn, GitHub highlighted the update, stating:
“Streamline your fork-based contributions with the latest GitHub CLI update! There’s now more support for triangular workflows, which means managing pull requests between your fork and the original repo is now significantly smoother and more efficient.”
A user, N8Group, responded with:
“It’s great to see the GitHub CLI finally supporting triangular workflows! This solves a long-standing pain point for teams with forks and complex branch strategies.”
For developers engaged in open-source projects or those who frequently work with forked repositories, this enhancement to the GitHub CLI simplifies the workflow, reducing friction and aligning command-line operations more closely with Git’s native behavior.
Triangular workflows – where developers fork a repository, make changes locally, and submit pull requests back to the original repository – are common in open-source and collaborative development. Outside of this new GitHub approach, Continuous Integration/Continuous Deployment (CI/CD) platforms have varying levels of support for these workflows, each with its own set of features and limitations.
GitLab facilitates triangular workflows by allowing users to fork repositories and create merge requests that return changes to the upstream project. CI/CD pipelines can be configured to run for these merge requests, providing a seamless integration experience. Additionally, GitLab offers features like fork synchronization and pull mirroring to keep forks up-to-date with the upstream repository.
Bitbucket also supports pipelines for pull requests from forks, but there are some caveats. By default, pipelines do not run automatically for pull requests from forks to prevent unauthorized access to secrets and other sensitive data. Repository administrators must explicitly enable this feature and carefully manage permissions to strike a balance between security and contributor convenience.
Interested readers can learn more at the GitHub blog and download the CLI via their favourite package manager or the cli.github.com website.