Windows Server 2012 安装 Git — 详细步骤与问题解决

当前状态

未找到Git

  • ✅ Python 已识别(C:\Program Files\python\python.exe)
  • ❌ Git 未安装或未添加到 PATH

解决方案

第一步:安装 Git

推荐安装 Git for Windows。从 https://git-scm.com/download/win 下载安装包。

关键选项:

  • 调整 PATH 环境:选择 “Git from the command line and also from 3rd-party software”(最关键)
  • 换行符转换:选择 “Checkout Windows-style, commit Unix-style line endings”

安装完成后,关闭所有 PowerShell 窗口,重新打开一个,验证:

git --version

第二步:验证并继续安装

python --version
git --version
Invoke-WebRequest -Uri https://cdn.link-ai.tech/code/cow/run.ps1 -OutFile C:\temp\run.ps1 -UseBasicParsing
C:\temp\run.ps1

替代方案(不安装 Git)

可以从 Gitee 下载源码包:https://gitee.com/zhayujie/CowAgent/repository/archive/master.zip

解压到 C:\CowAgent 目录,然后手动安装依赖:

cd C:\CowAgent
python.exe -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

常见问题排查

问题 解决方法
安装 Git 后仍提示找不到 关闭所有 PowerShell 窗口重新打开,或手动刷新 PATH
下载安装包很慢 使用国内镜像:https://npm.taobao.org/mirrors/git-for-windows/
提示无法验证数字签名 可以忽略,或在安装时选择仍要运行
服务声明: 本网站除正版商用版块可商用外,其他所有发布的源码、软件和资料均为作者提供或网友推荐收集各大资源网站整理而来,仅供功能验证和学习研究使用,您必须在下载后24小时内删除。不得使用于非法商业用途,不得违反国家法律,否则后果自负!一切关于该资源商业行为与本站无关。如果您喜欢该程序,请支持购买正版源码,得到更好的正版服务。如有侵犯你的版权合法权益,请邮件或QQ:3089659733与我们联系处理删除(邮箱:ynzsy@qq.com),本站将立即更正。