I recently made a fresh install of windows and all the tools I needed to develop software including git-for-windows. Unfortunatnly git-for-windows doesn't come with a packagemanager buildt in and going full cygwin seems a little overkill. After some research I ran in to this post on stackoverflow describing a way to install pacman
in to git-for-windows. Unfortuntly only "most of it" worked in my case. This document attempts to describe the entire process I went through to install pacman.
The packages in the MSYS2 repositoy seem to be packaged using zstd
now and not xz
as described. Obviously it would be great to use a package manager to install zstd
and un-tar
the files... Given that this guide is geared towards windows installs you can install 7zip and add the Modern7z plugins to unpack zstd
files.
Download the following packages from the MSYS2 repository: pacman, pacman-mirrors, msys2-keyring. In your ~/Downloads
directory unpack the files to just the tar files and open a bash terminal as administrator.
# In your elevated terminal we're going to unpack the files
cd /
tar x -vf ~/Downloads/msys2-keyring-1~20201002-1-any.pkg.tar usr
tar x -vf ~/Downloads/pacman-mirrors-20201028-1-any.pkg.tar etc
tar x -vf ~/Downloads/pacman-5.2.2-4-x86_64.pkg.tar usr
After unpacking pacman we can touch a configuration file and setup the keyrings, for good measure I took the config file from the git-sdk:
# Grab a fresh config file
curl --location https://github.com/git-for-windows/git-sdk-64/blob/main/etc/pacman.conf > /etc/pacman.conf
# Add the git-for-windows-keyring and locally sign
curl --location https://raw.githubusercontent.com/git-for-windows/build-extra/master/git-for-windows-keyring/git-for-windows.gpg | pacman-key --add - && pacman-key --lsign-key 1A9F3986
the url for /etc/pacman.conf is incorrect. it should be: