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

6

20

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.

Fatality answered 17/2, 2022 at 17:28 Comment(0)
M
13

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.

Mckinley answered 1/4, 2022 at 21:18 Comment(0)
H
1

It seems that users cannot get rid of github compare & pull request util now and you can also check out here for more details.

Hope answered 30/4, 2023 at 14:5 Comment(0)
E
0

I had this issue with gh-pages branch. I wanted the branch for future hosting, but not ready to make pages public yet. So the answer was to set the Pages branch to None instead of swapping it over to the Actions option. For whatever reason now I don't get PR notifications for gh-pages which has a totally different git history anyway.

Eelpout answered 19/1, 2023 at 18:29 Comment(0)
L
0

My workaround is using a browser extension like Firefox Stylus and hide different compare links via CSS:

@-moz-document url-prefix("https://github.com/sulu/sulu") {
    [class^="Flash__StyledFlash"]:has([href^="/sulu/sulu/compare/1."]),
    [class^="Flash__StyledFlash"]:has([href^="/sulu/sulu/compare/2."]),
    [class^="Flash__StyledFlash"]:has([href^="/sulu/sulu/compare/3."]),
    [class^="Flash__StyledFlash"]:has([href^="/sulu/sulu/compare/4."]),
    [class^="Flash__StyledFlash"]:has([href^="/sulu/sulu/compare/5."]) {
        display: none;
    }
}
Livestock answered 15/3, 2024 at 10:12 Comment(0)
R
-4

click on branches and see delete button (bin image) to delete the branch and remove this.

Reinertson answered 9/11, 2022 at 9:29 Comment(0)
M
-8
git push -d origin <branchname>

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

Meade answered 9/8, 2022 at 22:32 Comment(2)
This does not answer OP's question at all. Of course if you delete the given branch, the message will disappear... But that's far from the original intent i.e. to simply remove the message, not the branch which is suppose to stay there and is not supposed to be merged.Muscovite
What is your answer to this topic?, I gave a valid solution, the one I'm using since I was trying to hide that message and I came up with that based on other threads, the solution provided in the other answer pollutes GH logs and maybe notify people unnecessaryMeade

© 2022 - 2025 — McMap. All rights reserved.