

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 對 git-remote-codecommit 和 進行故障診斷 AWS CodeCommit
<a name="troubleshooting-grc"></a>

以下資訊可以協助您對與 AWS CodeCommit 儲存庫連線時可能會遇到的 **git-remote-codecommit** 相關問題進行故障診斷。

**Topics**
+ [我看到錯誤：git：'remote-codecommit' 不是 git 命令](#troubleshooting-grc-syn1)
+ [我看到錯誤：嚴重：找不到 'codecommit' 的遠端協助程式](#troubleshooting-grc-syn2)
+ [複製錯誤：我無法從 IDE 複製 CodeCommit 儲存庫](#troubleshooting-grc-ide1)
+ [推送或提取錯誤：我無法將遞交從 IDE 推送或提取至 CodeCommit 儲存庫](#troubleshooting-grc-ide2)
+ [安裝錯誤：當我嘗試安裝 git-remote-codecommit 時，externally-managed-environment錯誤](#troubleshooting-grc-pm1)

## 我看到錯誤：git：'remote-codecommit' 不是 git 命令
<a name="troubleshooting-grc-syn1"></a>

**問題：**當您嘗試使用 git-remote-codecommit 時，您會看到 git-remote-codecommit 不是 git 命令的錯誤。請參閱「git --help」。

**可能的修正：**此錯誤的最常見原因是您尚未將 git-remote-codecommit 可執行檔新增至 PATH，或字串包含語法錯誤。當 git 和 remote-codecommit 之間缺少連字號，或在 git-remote-codecommit 之前放置額外的 git 時，可能會發生這種情況。

如果您已將本機安裝更新為不支援的版本，也可能會遇到此錯誤。如需 Python 支援版本的詳細資訊，請參閱 [git-remote-codecommit](https://pypi.org/project/git-remote-codecommit/)。

如需設定和使用 git-remote-codecommit 的詳細資訊，請參閱 [AWS CodeCommit 使用 git-remote-codecommit 對 HTTPS 連線的設定步驟](setting-up-git-remote-codecommit.md)。

## 我看到錯誤：嚴重：找不到 'codecommit' 的遠端協助程式
<a name="troubleshooting-grc-syn2"></a>

**問題：**當您嘗試使用 git-remote-codecommit 時，您會看到錯誤，指出「嚴重：找不到適用於 'codecommit' 的遠端協助程式」。

**可能的修正：**此錯誤的最常見原因是：
+ git-remote-codecommit 的設定未完成
+ 您已在不在路徑中或未設定為`Path`環境變數一部分的位置安裝 git-remote-codecommit 
+ Python 不在您的路徑中，或未設定為`Path`環境變數的一部分
+ 您正在使用安裝 git-remote-codecommit 完成後尚未重新啟動的終端機或命令列視窗

如需設定和使用 git-remote-codecommit 的詳細資訊，請參閱 [AWS CodeCommit 使用 git-remote-codecommit 對 HTTPS 連線的設定步驟](setting-up-git-remote-codecommit.md)。

## 複製錯誤：我無法從 IDE 複製 CodeCommit 儲存庫
<a name="troubleshooting-grc-ide1"></a>

**問題：**當您嘗試在 IDE 中複製 CodeCommit 儲存庫時，您會看到錯誤，指出端點或 URL 無效。

**可行的修正方法：**並非所有 IDE 皆可支援 **git-remote-codecommit** 在複製期間使用的 URL。透過終端機或命令列從本機複製儲存庫，然後將該本機儲存庫新增到 IDE。如需詳細資訊，請參閱[步驟 3：連線至 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-remote-codecommit** 等 Git 遠端協助程式不相容。透過命令列或終端機使用 Git 命令手動更新本機儲存庫，而不要使用 IDE 功能來遞交、推送和提取程式碼。

如需遠端協助程式和 Git 的詳細資訊，請參閱 [Git 文件](https://git-scm.com/docs/gitremote-helpers)。

## 安裝錯誤：當我嘗試安裝 git-remote-codecommit 時，externally-managed-environment錯誤
<a name="troubleshooting-grc-pm1"></a>

**問題：**當您嘗試執行 `pip install git-remote-codecommit`命令時，您會看到錯誤，指出環境是外部管理。

**可能的修正：**此錯誤的最常見原因是您正在執行 Python 的分佈 （分佈），以定義 EXTERNALLY-MANAGED 標記檔案。最好的解決方案是建立和使用虛擬環境。

如需外部受管環境和 Python 的詳細資訊，請參閱 Python 文件中的[外部受管環境](https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments)和[使用 pip 和 venv 在虛擬環境中安裝套件](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/)。