

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

# 故障排除 git-remote-codecommit和 Amazon CodeCommit
<a name="troubleshooting-grc"></a>

以下信息可帮助您排查在连接 Amazon CodeCommit 存储库时遇到的与 **git-remote-codecommit** 有关的错误。

**Topics**
+ [我看到一个错误：git: 'remote-codecommit' is not a git command](#troubleshooting-grc-syn1)
+ [我看到一个错误：fatal: Unable to find remote helper for 'codecommit'](#troubleshooting-grc-syn2)
+ [克隆错误：我无法从 IDE 中克隆 CodeCommit 存储库](#troubleshooting-grc-ide1)
+ [推送或拉取错误：我无法将提交从 IDE 推送或拉取到 CodeCommit 存储库](#troubleshooting-grc-ide2)
+ [安装错误：我在尝试安装时看到 externally-managed-environment错误 git-remote-codecommit](#troubleshooting-grc-pm1)

## 我看到一个错误：git: 'remote-codecommit' is not a git command
<a name="troubleshooting-grc-syn1"></a>

**问题：**当你尝试使用时 git-remote-codecommit，你会看到一个不 git-remote-codecommit是 git 命令的错误。See 'git --help'”。

**可能的修复：**此错误的最常见原因是您尚未将 git-remote-codecommit可执行文件添加到 PATH 中，或者字符串包含语法错误。当 git 和 remote-codecommit 之间缺少连字符，或者前面放了一个额外的 git 时，就会发生这种情况。 git-remote-codecommit

如果您已经将本地安装更新到不支持的版本，也可能会遇到此错误。有关支持的 Python 版本的更多信息，请参阅[git-remote-codecommit](https://pypi.org/project/git-remote-codecommit/)。

有关设置和使用的更多信息 git-remote-codecommit，请参阅[使用的 HTTPS 连接 Amazon CodeCommit 的设置步骤 git-remote-codecommit](setting-up-git-remote-codecommit.md)。

## 我看到一个错误：fatal: Unable to find remote helper for 'codecommit'
<a name="troubleshooting-grc-syn2"></a>

**问题：**当你尝试使用时 git-remote-codecommit，你会看到一条错误消息，指出 “致命：找不到'codemmit'的远程助手”。

**可能的修复措施：**出现此错误的最常见原因包括：
+ 的设置未完成 git-remote-codecommit
+ 您的安装位置不 git-remote-codecommit在您的路径中或未配置为`Path`环境变量的一部分
+ Python 不在您的路径中或者没有配置为 `Path` 环境变量的一部分
+ 您使用的终端或命令行窗口自安装完成后尚未重新启动 git-remote-codecommit

有关设置和使用的更多信息 git-remote-codecommit，请参阅[使用的 HTTPS 连接 Amazon CodeCommit 的设置步骤 git-remote-codecommit](setting-up-git-remote-codecommit.md)。

## 克隆错误：我无法从 IDE 中克隆 CodeCommit 存储库
<a name="troubleshooting-grc-ide1"></a>

**问题：**尝试在 IDE 中克隆 CodeCommit 存储库时，会看到一个错误，提示端点或 URL 无效。

**可能的修复：**并非所有人都 IDEs 支持克隆**git-remote-codecommit**期间使用的 URL。从终端或命令行本地克隆存储库，然后将该本地存储库添加到 IDE 中。有关更多信息，请参阅 [步骤 3：Connect 连接到 CodeCommit 控制台并克隆存储库](setting-up-git-remote-codecommit.md#setting-up-git-remote-codecommit-connect-console)。

## 推送或拉取错误：我无法将提交从 IDE 推送或拉取到 CodeCommit 存储库
<a name="troubleshooting-grc-ide2"></a>

**问题：**当您尝试从 IDE 中提取或推送代码时，会看到连接错误。

**可能的修复：**此错误的最常见原因是 IDE 与 Git 远程辅助程序（如 **git-remote-codecommit**）不兼容。使用 Git 命令从命令行或终端手动更新本地存储库，而不是使用 IDE 功能提交、推送和拉取代码。

有关远程辅助程序和 Git 的更多信息，请参阅 [Git 文档](https://git-scm.com/docs/gitremote-helpers)。

## 安装错误：我在尝试安装时看到 externally-managed-environment错误 git-remote-codecommit
<a name="troubleshooting-grc-pm1"></a>

**问题：**当您尝试运行 `pip install git-remote-codecommit` 命令时，会出现一个错误，表明环境是在外部管理的。

**可能的修复措施：**出现此错误的最常见原因是您正在运行定义 EXTERNALLY-MANAGED 标记文件的 Python 发行版。针对这一错误的优秀解决方案是创建和使用虚拟环境。

有关外部管理的环境和 Python 的更多信息，请参阅 Python 文档中的 [Externally Managed Environments](https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments) 和 [Install packages in a virtual environment using pip and venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)。