Skip to main content

GitHub Copilot 指南

了解如何用于 GitHub Copilot 完成特定任务。

聚焦

从GitHub问题实现功能

从GitHub问题实现功能

向GitHub提出一个问题GitHub Copilot 命令行界面 (CLI),然后引导对话朝着实现该功能的方向进行。
    诊断 CI 测试失败

    诊断 CI 测试失败

    用于 Copilot 命令行界面(CLI) 拉取 CI 日志、将故障关联到本地代码,并在不离开终端的情况下修复问题。
      提高代码可读性和可维护性

      提高代码可读性和可维护性

      副驾驶聊天 可以建议使代码更易于理解和维护的方法。

        浏览 35 示例

        • 创建模板

          副驾驶聊天 可帮助你创建模板,以简化工作流并确保项目中的一致性。
          • Communicate effectively
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 分类整理并汇总存储库活动

          Copilot 可以从你关注的存储库中提取关键信息,帮助你及时了解最近的活动。
          • Communicate effectively
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • CLI
        • 合成研究

          Copilot 对话助手可帮助你将来自多个来源的研究结果和见解合成为一份连贯的摘要。
          • Communicate effectively
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 创建关系图

          GitHub Copilot 对话助手 可以帮助你创建图表,以便更好地了解数据并传达见解。
          • Communicate effectively
          • Visualize data
          • Scale institutional knowledge
          • Author and optimize with Copilot
          • Chat
        • 表格生成

          副驾驶聊天 可帮助你创建表来组织信息并清楚地显示它。
          • Communicate effectively
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 调试无效的 JSON

          副驾驶聊天 可以识别和解决 JSON 数据中的语法错误或结构问题。
          • Debugging code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 处理 API 速率限制

          副驾驶聊天 通过建议检测 API 速率限制并实现重试逻辑的代码,可以帮助处理 API 速率限制。
          • Debugging code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 诊断 CI 测试失败

          用于 Copilot 命令行界面(CLI) 拉取 CI 日志、将故障关联到本地代码,并在不离开终端的情况下修复问题。
          • Debugging code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • CLI
        • 探索潜在的功能实现

          副驾驶聊天 可以帮助探索实现单个功能的不同方法。
          • Functionality analysis
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 分析和采纳用户反馈

          副驾驶聊天 可以增强将用户反馈合并到项目中的过程。
          • Functionality analysis
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 从GitHub问题实现功能

          向GitHub提出一个问题GitHub Copilot 命令行界面 (CLI),然后引导对话朝着实现该功能的方向进行。
          • Author and optimize with Copilot
          • CLI
        • 提高代码可读性和可维护性

          副驾驶聊天 可以建议使代码更易于理解和维护的方法。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 修复 lint 错误

          副驾驶聊天 可以为修复代码检查器识别出的问题提供建议。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 为性能优化而重构

          副驾驶聊天 可以建议加快运行速度缓慢的代码的方法。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 为环境可持续性进行重构

          副驾驶聊天 可以建议使代码更加环保的方法。
          • Refactoring code
          • Improve quality and maintainability
          • Author and optimize with Copilot
          • Chat
        • 重构以实现设计模式

          副驾驶聊天 可以建议可用于改进代码的设计模式。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 重构数据访问层

          副驾驶聊天 可以建议将数据访问代码与业务逻辑分离的方法,使应用程序更易于维护和缩放。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 将业务逻辑从 UI 组件中分离出来

          副驾驶聊天 可以帮助你将业务逻辑与用户界面代码分开,从而更轻松地维护和缩放应用程序。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 处理横切关注点

          副驾驶聊天 可帮助你避免编写与代码所在方法或函数的核心关注点无关的代码。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 简化复杂的继承层次结构

          副驾驶聊天 可帮助你重构代码以避免具有多层继承的类。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 修复数据库死锁或数据一致性问题

          副驾驶聊天 可帮助你避免导致数据库操作缓慢或阻塞的代码,或者缺少或不正确的数据表。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 将代码转换为其他编程语言

          副驾驶聊天 可帮助你重写代码以执行相同的操作,但使用不同的编程语言。
          • Refactoring code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 在不中断工作流程的情况下提交问题

          当你在处理任务时注意到某个问题,可以使用 Copilot 命令行界面(CLI) 创建一个包含代码上下文、关联 PR 和标签的 GitHub issue,然后继续手头的工作。
          • Documenting code
          • Author and optimize with Copilot
          • CLI
        • 为旧代码编写文档

          副驾驶聊天 有助于记录旧代码。
          • Documenting code
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 解释旧代码

          副驾驶聊天 可以帮助解释不熟悉的代码。
          • Documenting code
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 解释复杂算法或逻辑

          副驾驶聊天 可以帮助添加有关复杂算法或逻辑的清晰简洁文档。
          • Documenting code
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 同步文档以适应代码更改

          副驾驶聊天 可以帮助保持代码文档为最新状态。
          • Documenting code
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 撰写讨论或博客文章

          副驾驶聊天 可以帮助你生成想法、大纲或草稿讨论或博客文章。
          • Documenting code
          • Author and optimize with Copilot
          • Scale institutional knowledge
          • Chat
        • 生成单元测试

          副驾驶聊天 可以帮助生成函数的单元测试。
          • Testing code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 创建模拟对象来使层抽象化

          副驾驶聊天 有助于创建可用于单元测试的模拟对象。
          • Testing code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 为网页创建端到端测试

          副驾驶聊天 有助于生成端到端测试。
          • Testing code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 更新单元测试以匹配代码更改

          副驾驶聊天 可以帮助你更新测试用例。
          • Testing code
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 保护您的仓库

          副驾驶聊天 可以帮助你保护存储库和代码。
          • Security analysis
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 管理依赖项更新

          副驾驶聊天 可以帮助你设置 Dependabot,以简化依赖项更新流程。
          • Security analysis
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat
        • 在代码中查找现有漏洞

          Copilot 对话助手 可以帮助查找代码中的常见漏洞并提供修复建议。
          • Security analysis
          • Author and optimize with Copilot
          • Improve quality and maintainability
          • Chat