---
title: "Github一直显示有未读通知怎么办？"
description: "最近有人在 Github 上群发垃圾邮件，被屏蔽后出现了“幽灵邮件” —— 在通知上一直显示着一个小蓝点，但是点进去之后又发现实际上根本没有通知。"
canonical_url: "https://yangqiuyi.com/blog/kai-fa/github-yi-zhi-xian-shi-you-wei-du-tong-zhi-zen-me-ban"
---

> Index of every page on this site: [llms.txt](https://yangqiuyi.com/llms.txt)

# Github一直显示有未读通知怎么办？

最近有人在 Github 上群发垃圾邮件，被屏蔽后出现了“幽灵邮件” —— 在通知上一直显示着一个小蓝点，但是点进去之后又发现实际上根本没有通知。

解决方案就是直接调用接口去设置这些邮件为已读

## 方法 1: Github CLI

为了方便调用Github API，我下载了 Github CLI：[https://cli.github.com/](https://cli.github.com/)

安装之后可以在命令行执行：`gh auth login` 进行登陆

登陆完成后使用该指令，调用接口将邮件设为已读：

```sh
gh api --method PUT -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /notifications -f last_read_at="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -F read=true
```

## 方法 2： curl

如果你不想下载 Github CLI，也可以尝试一下这个方法，直接调用 curl 去请求接口，但是，不知为何，这个方法对我没有效果：

- [https://github.com/orgs/community/discussions/6874?utm_source=chatgpt.com#discussioncomment-2859125](https://github.com/orgs/community/discussions/6874?utm_source=chatgpt.com#discussioncomment-2859125)

## 参考

- [https://github.com/orgs/community/discussions/174698#discussioncomment-14509092](https://github.com/orgs/community/discussions/174698#discussioncomment-14509092)

## Sitemap

See the full [sitemap](https://yangqiuyi.com/sitemap.md) for all pages.
