问题
I was about to follow the instructions to delete all branches on remote that are already merged:
git branch -r --merged | grep -v master | sed 's/origin\//:/'
| xargs -n 1 git push origin
from How can I delete all Git branches which have been merged?
But noticed WARNING: This command will delete and close open pull requests. – Diego Aug 14 '17 at 15:19
As I understand , git branch -r --merged will return only branches, not pull requests.
Is a warning about the scenario when source or target branch of pull request has been merged to master and therefore deleted by the command? it will make such pull request invalid and has to be closed.
Or some other scenarios are effected?
As pull requests are not a core feature of git, they are supported by different Git hosting services. Does the deletion of pull requests effect all hosts or only some, such as GitHub?
Is any way to avoid closing open pull requests when clean up merged git branches?
来源:https://stackoverflow.com/questions/65444886/how-clean-up-merged-git-branches-can-delete-pull-requests