How to get rid of GitHub's 'compare & pull request' suggestion

Viewed 1225

I have created a new branch that contains all images used in the projects README.md. It is supposed to never get merged and is just there to keep the main branch tidy.

GitHub displays a very big yellow 'compare & pull request' above the repository now.

GitHub compare & pull request message

How can I get rid of this message? It is very distracting. Will it go away after some time on its own?

It seems I also cannot create a pull request and then decline it. When I click on 'compare & pull request', I only get forwarded to a 'There isn’t anything to compare.' page without any further options.

2 Answers

I was wondering that same thing and there is no out of the box way to do it with my current knowledge.

Buuuut, I have found a workaround in Github where you can click Compare & Pull Request then before they ask you to Merge Pull Request, just close the pull request instead. No harm done and Github thinks you've adequately checked out all of the changes.

I found this to be a good fast way to remove the suggestion in the event it was annoying me.

git push -d origin <branchname>

where: origin is your remote origin (it can be another name but usually is origin)

Related