I made and merged a PR and want to rename the branch I made the PR off of. How can I do this? Let me know if you have questions.
Asked
Active
Viewed 561 times
1
-
Does this answer your question? [Renaming a branch while on pull request](https://stackoverflow.com/questions/20007578/renaming-a-branch-while-on-pull-request) – Sharad May 19 '21 at 05:20
-
@Sharad I think this is only for open PRs. – NGI May 19 '21 at 05:46
-
You can rename the branch wherever you like, but if the merge is already done, this has no effect on the merge. The merge is done. – torek May 19 '21 at 06:06
1 Answers
-1
Editing post to give a reference on how to change the branch name inside an already merged PR. I practically tried this on my side, pushed to GitHub, changed the branch name in the PR that is merged, I can clearly see the change reflecting.
Please follow the below steps:
(base) Apples-MacBook-Pro:CrashCall pratapalokraj$ git branch
* Test
main
(base) Apples-MacBook-Pro:CrashCall pratapalokraj$ git push origin Test
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'Test' on GitHub by visiting:
remote: https://github.com/Blank000/CrashCall/pull/new/Test
remote:
To github.com:Blank000/CrashCall.git
* [new branch] Test -> Test
After pushing changes in a new branch ( Test ), now I raised a PR with Test branch and merged into main as below and then changed the branch name from Test to Renamed_Test:
Click on view all branches from the below screenshot
Click on the right most edit button you see down below:
For reference you can also visit this page:

halfer
- 19,824
- 17
- 99
- 186

Pratap Alok Raj
- 1,098
- 10
- 19
-
-
-
Thanks for pointing out my misunderstanding, appreciate your efforts. I have added all the steps on how you can change the branch. Please upvote me if you find the answer useful – Pratap Alok Raj May 19 '21 at 07:15