

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# GitHub 版 Amazon Q 开发者版故障排查
<a name="github-troubleshooting"></a>

若在使用 GitHub 版 Amazon Q 开发者版时遇到常见问题，可参考以下部分进行排查。

## 在有分支保护规则的存储库中，Amazon Q 开发者版无法生成拉取请求
<a name="github-troubleshooting-branch-protection"></a>

**问题描述**：我的 GitHub 存储库配置了分支保护规则，导致 Amazon Q 开发者版无法在该存储库中创建拉取请求。

**解决方案**：分支保护规则会阻止 Amazon Q 开发者版创建分支，进而无法创建拉取请求。若要在有分支保护规则的存储库中使用 GitHub 版 Amazon Q 开发者版，需将 Amazon Q 开发者版应用添加到允许列表中。

**要将 Amazon Q 开发者版应用程序添加到允许列表，请执行以下步骤**

1. 如有需要，可使用您的 GitHub 凭证登录 [https://github.com/](https://github.com/) 账户。

1. 导航至您的 GitHub 组织，然后进入您希望将 GitHub 版 Amazon Q 开发者版应用加入允许列表的存储库。

1. 选择**设置**，然后在导航窗格中选择**分支**。

1. 在**分支保护规则**下，选择**编辑**以修改分支保护规则。

1. 选择**限制创建匹配分支的推送**，然后搜索 GitHub 版 Amazon Q 开发者版应用程序。

1. 选择**保存更改**，允许 Amazon Q 开发者版为带有其标签的问题创建拉取请求。

要了解更多在 GitHub 中修改分支保护规则的信息，请参阅[创建分支保护规则](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule#creating-a-branch-protection-rule)。

## GitHub 问题中缺少 Amazon Q 开发者版标签
<a name="github-troubleshooting-labels"></a>

**问题**：我看不到GitHub问题中的 **Amazon Q 开发代理**标签。

**解决方案**：如果您在安装 Amazon Q Developer for GitHub 应用程序时未自动创建标签，或者标签被无意中删除，则可以在中手动创建标签GitHub。必须将该标签命名为 **Amazon Q 开发代理**，才能将其识别为 Amazon Q 开发者标签并进行处理。有关更多信息，请参阅《GitHub 文档》**中的[创建标签](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels#creating-a-label)。

## Amazon Q 开发者版无法为 GitHub 问题生成代码
<a name="github-troubleshooting-generate-code"></a>

**问题描述**：我创建了一个 GitHub 问题并调用 Amazon Q 开发者版执行任务，但收到以下一系列关于技术故障的提示消息：

1. ⏳ I'm working on generating code for this issue. I'll update this issue with a comment and open a pull request when I'm done.

1. ⚠️ I'm having technical difficulties. I couldn't solve the issue. I'm going to try again. This might take some time.

1. ⚠️ I'm having technical difficulties. I couldn't solve the issue. I'm going to try again. This might take some time.

1. 🔴 I'm having technical difficulties. I couldn't solve the issue.

   Consider reassigning this issue to a user. This will help you stay within the quotas for generative AI feature usage.

**解决方案**：如果 Amazon Q Developer 无法处理您的问题并为其生成代码，请创建一个新问题并在新问题上贴上 **Amazon Q 开发代理**标签。要了解有关创建议题和应用 Amazon Q 开发者代理标签的更多信息，请参阅[在 GitHub 中使用 Amazon Q 开发者版开发功能并迭代](github-feature-development.md)。