gh-issue-sync
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesegh-issue-sync
gh-issue-sync
Syncs GitHub issues to local Markdown files in and .
.issues/open/.issues/closed/将GitHub Issues同步到本地和目录下的Markdown文件中。
.issues/open/.issues/closed/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.mdmarkdown
---
title: Fix login bug
labels: [bug, priority:high]
assignees: [alice]
milestone: v1.0
state: open.issues/open/42-fix-login-bug.mdmarkdown
---
title: Fix login bug
labels: [bug, priority:high]
assignees: [alice]
milestone: v1.0
state: openFor 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 -prefixed ID (e.g., ). The filename must start with :
TT1a2b3cT.issues/open/T1a2b3c-my-new-issue.mdOn , the file is renamed to the real issue number (e.g., ) and in frontmatter is updated. Any references in other issues are also updated to .
push42-my-new-issue.mdnumber:#T1a2b3c#42新建的Issue会获得一个以开头的ID(例如:)。文件名必须以开头:
TT1a2b3cT.issues/open/T1a2b3c-my-new-issue.md执行命令时,文件会重命名为真实的Issue编号(例如:),同时前置元数据中的字段会更新。其他Issue中所有引用的地方也会自动更新为。
push42-my-new-issue.mdnumber:#T1a2b3c#42Comments
评论
To post a comment when pushing, create a file next to the issue:
.comment.md.issues/open/42.comment.md
.issues/open/42-fix-login-bug.comment.mdContent 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 to overwrite local
--force
- 执行pull操作时会跳过冲突文件;可使用参数覆盖本地文件
--force