首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> 更多程式語言 >> 程式設計綜合問答

GitHub 安裝失敗?Windows 10 下常見問題與解決方案

     編輯:程式設計綜合問答

現象描述

Windows 10 運行 GitHubSetup.exe 安裝失敗,嘗試 IE 設置可信站點後仍報錯。

核心原因排查

  1. 安裝包下載不全/損壞:官網直鏈在國內極慢,建議使用鏡像站(如 https://github.com/git-for-windows/git/releases/download/...)或迅雷下載。
  2. 殺毒軟件攔截:Windows Defender/360/火綠可能誤攔截安裝程序寫入註冊表、創建服務。暫時關閉實時防護再安裝。
  3. 路徑含中文/特殊字符:安裝目錄請使用純英文路徑,如 D:\Git。
  4. 缺少系統依賴:需預裝 Visual C++ Redistributable 2015-2022 (x64)。
  5. 權限不足:右鍵安裝包選「以管理員身份運行」。

推薦安裝流程

  1. 從 npmmirror 鏡像 下載最新 Git-2.x.x-64-bit.exe。
  2. 關閉殺毒軟件,右鍵以管理員身份運行。
  3. 安裝選項保持默認,關鍵節點確認:
    • Adjusting your PATH environment → 選 Git from the command line and also from 3rd-party software。
    • Choosing the SSH executable → 選 Use bundled OpenSSH。
    • Configuring the line ending conversions → 選 Checkout Windows-style, commit Unix-style。
  4. 安裝完成後,PowerShell 執行 git --version 驗證。

替代方案

  • Scoop:scoop install git 一鍵安裝並管理版本。
  • Chocolatey:choco install git.install。
  • Git for Windows Portable:解壓即用,無需安裝,適合 U 盤攜帶。

驗證 SSH 金鑰生成

ssh-keygen -t ed25519 -C "your_email@example.com"
# 按三次回車,公鑰在 ~/.ssh/id_ed25519.pub
cat ~/.ssh/id_ed25519.pub  # 複製到 GitHub Settings → SSH Keys
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved