

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

# 故障診斷 AWS CodeCommit
<a name="troubleshooting"></a>

以下資訊可能有助於診斷 AWS CodeCommit內的常見問題。

**Topics**
+ [對 Git 登入資料和 HTTPS 連線進行故障診斷 AWS CodeCommit](troubleshooting-gc.md)
+ [對 git-remote-codecommit 和 進行故障診斷 AWS CodeCommit](troubleshooting-grc.md)
+ [對 的 SSH 連線進行故障診斷 AWS CodeCommit](troubleshooting-ssh.md)
+ [對登入資料協助程式和 HTTPS 連線進行故障診斷 AWS CodeCommit](troubleshooting-ch.md)
+ [故障診斷 Git 用戶端和 AWS CodeCommit](troubleshooting-git.md)
+ [對存取錯誤和 進行故障診斷 AWS CodeCommit](troubleshooting-ae.md)
+ [故障診斷組態錯誤和 AWS CodeCommit](troubleshooting-cf.md)
+ [對主控台錯誤和 進行故障診斷 AWS CodeCommit](troubleshooting-cs.md)
+ [對觸發和 進行故障診斷 AWS CodeCommit](troubleshooting-ti.md)
+ [開啟偵錯](#troubleshooting-debug)

## 開啟偵錯
<a name="troubleshooting-debug"></a>

**問題：**我想要開啟偵錯，以取得儲存庫和 Git 儲存庫執行命令情況的更多資訊。

**可能的修正：**嘗試下列項目：

1. 在終端機或命令提示字元中，於您的本機電腦上執行下列命令，之後再執行 Git 命令：

   在 Linux、macOS 或 Unix 上：

   ```
   export GIT_TRACE_PACKET=1
   export GIT_TRACE=1
   export GIT_CURL_VERBOSE=1
   ```

   在 Windows 上：

   ```
   set GIT_TRACE_PACKET=1
   set GIT_TRACE=1
   set GIT_CURL_VERBOSE=1
   ```
**注意**  
設定 `GIT_CURL_VERBOSE` 僅適用 HTTPS 連線。SSH 不會使用 `libcurl` 程式庫。

1. 若要取得 Git 儲存庫的詳細資訊，建議您安裝最新版本的 [git-sizer](https://github.com/github/git-sizer?tab=readme-ov-file#getting-started)。遵循適用於您作業系統和環境的 公用程式安裝說明。安裝後，在命令列或終端機將目錄變更為本機儲存庫，然後執行下列命令：

   ```
   git-sizer --verbose
   ```
**提示**  
考慮將命令的輸出儲存到檔案，以便在疑難排解問題時輕鬆與他人共用，特別是隨著時間的推移。