Reputation: 806
I mistakenly named a branch and pushed it to Github, even opened the pull request.
Now I want to rename the branch like this, But if I do, it will delete the old branch and create a new one with the correct name. The issue is, that I don't want the owner of the repo to see that I have deleted a branch. I completely want the branch with the wrong name gone from git history.
Is there any other way I can achieve this? I don't want to lose the code too. Please help me with this, I have searched a lot but couldn't find a related solution to my problem. Thanks
Upvotes: 1
Views: 273
Reputation: 489333
Git branch names are ephemeral. You can delete the branch name and it's gone. (The commits themselves are a different question as they are independent of the branch name.)
GitHub Pull Requests are permanent. They are not in Git, they are in GitHub. They are stored in a database that you cannot change. The only thing you can do here is contact GitHub support.
Upvotes: 3