Reputation: 3582
I have a few old pull requests that are no longer valid, but their refs are still hanging around.
how do I go about removing these old refs on the remote?
Upvotes: 4
Views: 3793
Reputation: 488183
You could, on the server itself, use git update-ref
to delete these references. That method is more or less guaranteed to work—but requires that you be able to log in on the server itself.
The in-Git alternative, which may or may not be allowed by the server, is to send the server a push request of the form "delete ", using, e.g.:
git push --delete origin refs/pull-requests/70/from refs/pull-requests/70/merge
or equivalently:
git push origin :refs/pull-requests/70/from :refs/pull-requests/70/merge
The server might reject this request, saying that references in the refs/pull-requests
namespace are reserved. If that's true, you're stuck with either:
It seems likely that the web interface (or similar) is the raison d'être for the use of that particular server in the first place: through their web interface, they provide features like "fork repository" and "make pull request".
Upvotes: 4