Azure / Azure/azure-devops-cli-extension
[Feature Request] `az repos pr update` change target branch
- Dominant language
- Python
- Stars
- 682
- Forks
- 278
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 3
Description
**Is your feature request related to a problem? Please describe.**
To be able to mimic something like Github's stacked PRs, I would need to be able to update the target branch of an active PR. This is possible via the DevOps site or the REST API, but the Azure CLI does not support it.
**Describe the solution you'd like**
Extend the `az repos pr update` with a `--target-branch` parameter, similar to how `az repos pr create` works.
```
--target-branch -t : Name of the target branch. If not specified, defaults to the
default branch of the target repository.
```
**Additional context**
Github's stacked PRs works by keeping a set of related branches in sync, and updating the related PRs to point to the upper branch in the stack.
* PR 1: `mystack/first` -> `develop`
* PR 2: `mystack/second` -> `mystack/first`
When any changes to the `mystack/first` branch are made, the `mystack/second` branch is rebased.
When PR 1 gets merged, PR 2 gets updated to point to `develop` instead.
Updates to the branches can be made with `git` commands, but changing the PR target branch is currently not possible from CLI.
This issue is just to add the target branch parameter, not to implement stacked PRs.
Contributor guide
Assessment
This issue has not been assessed yet.