当前位置: 首页 > 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.jsqmd.com/news/44006/

相关文章:

  • 图形渲染与 GPU 交互中的 C++ 性能优化技巧 - 教程
  • 详细介绍:代码随想录第七天|哈希表part02--454.四数相加II、383. 赎金信、15. 三数之和、18. 四数之和
  • 以太网交换机的吞吐量
  • Traefik:Go 实现的云原生反向代理,微服务路由自动化利器
  • 罗盘
  • 第一章 语法基础——语法基础
  • 计算机网络中最短帧长的概念
  • Cypher语法
  • 2025江浙沪方向专线物流、(冷库)往返运输、智能仓储优选服务商推荐:深耕江苏苏州、高邮、镇江,覆盖全国及国际线路,供应链定制方案/当日往返物流/智能共享仓储/分拨中心
  • 【Wireshark数据分析实战】 - 指南
  • 【贪心】P9525 [JOIST 2022] 团队竞技 / Team Contest 题解
  • noip9
  • 常见的steam游戏的营销错误
  • MX Round 26 解题报告
  • linux c 编译命令
  • N8N工作流中文转换神器!一键转中文
  • 今天学习黑马的Java基础
  • linux c 线程编程
  • 容器网络虚拟化
  • 整体二分学习笔记
  • CF1721F Matching Reduction
  • 树上求值 tree
  • DL 2 自动微分模块
  • 《计算机网络》学习心得
  • NSSCTF刷题日记
  • 2025防晒品牌TOP8精准推荐:按肤质与场景科学选择
  • 黑马程序员SpringCloud微服务开发与实战- Docker基础-02
  • 详细介绍:UE4_Niagara基础实例—15、粒子发射器之间的通信
  • 2025年目前口碑好的继承官司律师律所有哪些,遗产继承律师事务所/北京最好的继承律师/婚姻律师事务所/继承律师/北京继承纠纷律师律所哪家强
  • 老友记第一季人物表