当前位置: 首页 > news >正文

msys中安装git for window

看这个就好:Install inside MSYS2 proper
git-for-windows/pacman-repo: [TEST] Git for Windows' Pacman repository

1、编辑 /etc/pacman.conf ,在所有仓库之前添加 Git for Windows 仓库(第 #71 行的 [mingw32] 之前):

[git-for-windows-x86_64]
Server = https://raw.githubusercontent.com/git-for-windows/pacman-repo/refs/heads/x86_64[git-for-windows-mingw32]
Server = https://raw.githubusercontent.com/git-for-windows/pacman-repo/refs/heads/i686

2、避免前名问题,运行:

rm -r /etc/pacman.d/gnupg/
pacman-key --init
pacman-key --populate msys2

3、授权签名密钥:

curl -L https://raw.githubusercontent.com/git-for-windows/build-extra/HEAD/git-for-windows-keyring/git-for-windows.gpg |
pacman-key --add - &&
pacman-key --lsign-key E8325679DFFF09668AD8D7B67115A57376871B1C &&
pacman-key --lsign-key 3B6D86A1BA7701CD0F23AED888138B9E1A9F3986

4、强制更新仓库信息并强制安装更新(可能会降级)。这一步会安装一个全新的msys2-runtime,安装过程会询问退出msys2,同意。

pacman -Syyuu

5、强制安装更新(可能会降级)。

pacman -Suu

6、安装git

pacman -S mingw-w64-x86_64-{git,git-doc-html,git-doc-man} mingw-w64-x86_64-git-extra

7、检查git版本

git --version

输出的版本号带windows说明安装成功了

git version 2.31.0.windows.1

怎样把git-bash添加到右键菜单中? - 喻园的回答 - 知乎
创建一个reg文件,编辑为以下内容,双击打开即可

Windows Registry Editor Version 5.00[-HKEY_CLASSES_ROOT\Directory\Background\shell\open in git][HKEY_CLASSES_ROOT\Directory\Background\shell\open in git]
@="Git Bash Here"
"icon"="C:\\Git\\mingw64\\share\\git\\git-for-windows.ico"[HKEY_CLASSES_ROOT\Directory\Background\shell\open in git\command]
@="C:\\Git\\git-bash.exe"
http://www.gsyq.cn/news/53551.html

相关文章:

  • Traefik:Go 实现的云原生反向代理,微服务路由自动化利器
  • 第一章 语法基础——语法基础
  • Cypher语法
  • 2025江浙沪方向专线物流、(冷库)往返运输、智能仓储优选服务商推荐:深耕江苏苏州、高邮、镇江,覆盖全国及国际线路,供应链定制方案/当日往返物流/智能共享仓储/分拨中心
  • 【Wireshark数据分析实战】 - 指南
  • 树上求值 tree
  • DL 2 自动微分模块
  • 《计算机网络》学习心得
  • 2025防晒品牌TOP8精准推荐:按肤质与场景科学选择
  • 黑马程序员SpringCloud微服务开发与实战- Docker基础-02
  • 老友记第一季人物表
  • make指定安装目录
  • 【转载】银河麒麟(Kylin)操作系统上移植Qt 5.6.3与QtCreator 4.2.0的完整指南
  • wsl 与 docker相关内容
  • 2025.11.18模拟赛
  • 游戏联运模式与统一包模式
  • 日总结 28
  • 实用指南:AI: 生成Android自我学习路线规划与实战
  • 《算法设计与分析》第三章学习记录
  • #题解#洛谷 P3029 Cow Lineup S #双指针#离散化#
  • 如何创建你的百Google度!!(实现双搜索引擎页面)
  • P7152 [USACO20DEC] Bovine Genetics G
  • CF1592E Bored Bakry
  • 如何在ISA-95体系中采用Apache Camel + MQTT Broker衔接L3与L4 Legacy应用
  • 11月18日日记
  • 一文讲清:数据清洗、数据中台、数据仓库、数据治理 - 智慧园区
  • 人工智能之编程进阶 Python高级:第四章 数学类模块
  • Solon AI 开发学习 - 1导引
  • 2025 年 11 月滚珠丝杆厂家推荐排行榜,高负载滚珠丝杆,耐磨滚珠丝杆,检测仪器高速滚珠丝杆,螺母滚珠丝杆,医用自动化滚珠丝杆公司推荐
  • UE4/UE5反射系统动态注册机制解析 - 实践