gh-issue-sync

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

gh-issue-sync

gh-issue-sync

Syncs GitHub issues to local Markdown files in
.issues/open/
and
.issues/closed/
.
将GitHub Issues同步到本地
.issues/open/
.issues/closed/
目录下的Markdown文件中。

Commands

命令

gh-issue-sync init              # Initialize in git repo
gh-issue-sync pull              # Fetch open issues (--all for closed too)
gh-issue-sync push              # Push local changes (--dry-run to preview)
gh-issue-sync list              # List issues (supports gh issue list flags + --search)
gh-issue-sync new "Title"       # Create issue (--label, --edit)
gh-issue-sync close 42          # Close (--reason completed|not_planned)
gh-issue-sync reopen 42
gh-issue-sync status            # Show local changes
gh-issue-sync diff 42           # Show diff (--remote to re-fetch)
gh-issue-sync init              # 在Git仓库中初始化
gh-issue-sync pull              # 获取未关闭的Issues(添加--all参数可同时获取已关闭的)
gh-issue-sync push              # 推送本地更改(添加--dry-run参数可预览更改)
gh-issue-sync list              # 列出Issues(支持gh issue list的所有参数以及--search参数)
gh-issue-sync new "Title"       # 创建Issue(支持--label、--edit参数)
gh-issue-sync close 42          # 关闭Issue(添加--reason参数,可选值completed|not_planned)
gh-issue-sync reopen 42
gh-issue-sync status            # 显示本地更改状态
gh-issue-sync diff 42           # 显示差异(添加--remote参数可重新获取远程内容)

File Format

文件格式

.issues/open/42-fix-login-bug.md
:
markdown
---
title: Fix login bug
labels: [bug, priority:high]
assignees: [alice]
milestone: v1.0
state: open
.issues/open/42-fix-login-bug.md
:
markdown
---
title: Fix login bug
labels: [bug, priority:high]
assignees: [alice]
milestone: v1.0
state: open

For closed: state_reason: completed|not_planned

若为已关闭状态:state_reason: completed|not_planned

Optional: parent: 10, blocked_by: [11, 12], blocks: [15]

可选字段:parent: 10, blocked_by: [11, 12], blocks: [15]


Issue body in Markdown.

Issue number is derived from the filename, not stored in frontmatter.

Issue正文(Markdown格式)。

Issue编号由文件名派生,不会存储在前置元数据中。

Temporary Issues

临时Issues

New issues get a
T
-prefixed ID (e.g.,
T1a2b3c
). The filename must start with
T
:
.issues/open/T1a2b3c-my-new-issue.md
On
push
, the file is renamed to the real issue number (e.g.,
42-my-new-issue.md
) and
number:
in frontmatter is updated. Any
#T1a2b3c
references in other issues are also updated to
#42
.
新建的Issue会获得一个以
T
开头的ID(例如:
T1a2b3c
)。文件名必须以
T
开头:
.issues/open/T1a2b3c-my-new-issue.md
执行
push
命令时,文件会重命名为真实的Issue编号(例如:
42-my-new-issue.md
),同时前置元数据中的
number:
字段会更新。其他Issue中所有引用
#T1a2b3c
的地方也会自动更新为
#42

Comments

评论

To post a comment when pushing, create a
.comment.md
file next to the issue:
.issues/open/42.comment.md
.issues/open/42-fix-login-bug.comment.md
Content is plain Markdown. The file is deleted after the comment is posted.
若要在推送时发布评论,可在对应Issue文件旁创建一个
.comment.md
文件:
.issues/open/42.comment.md
.issues/open/42-fix-login-bug.comment.md
文件内容为纯Markdown格式。评论发布后,该文件会被自动删除。

Notes

注意事项

  • Pull skips conflicts; use
    --force
    to overwrite local
  • 执行pull操作时会跳过冲突文件;可使用
    --force
    参数覆盖本地文件