I want to change the name of the remote branch with the PR left behind.

Asked 2 years ago, Updated 2 years ago, 44 views

It is rare that I want to modify the branch name after I submit a pullik on github and get a review.How can I change the branch name without deleting the pullik?

``
There seems to be no command to rename the remote branch directly, so I copied it to another remote branch (remote_new) and removed the remote_old.

git checkout-b local branch name origin/remote_old
git push origin local branch name: remote_new
git push origin:remote_old
`

In this way, Pullik disappears.

git github

2022-09-30 10:30

1 Answers

As @ksaito said, the same question was asked at https://stackoverflow.com/q/20007578/3090068. As a push operation to the remote on git, as long as there is no renaming of the branch, it is inevitable to delete and create a new branch, and the github seems to have no choice but to close the PR.

The practical solution is to create a new PR, close the old PR, and refer the new and old to the destination and source.


2022-09-30 10:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.