Skip to content

Instantly share code, notes, and snippets.

@adojos
Last active February 24, 2024 15:37
Show Gist options
  • Save adojos/0abab00dd7e6bd84db39a760fb40a340 to your computer and use it in GitHub Desktop.
Save adojos/0abab00dd7e6bd84db39a760fb40a340 to your computer and use it in GitHub Desktop.
Git: Pacman Installation on Git For Windows #git

Git For Windows (GitBash) Pacman Installation

The 'Git for Windows' by default does not come with MSYS2 package manager called 'Pacman' and hence it is a limited version or subset of the MSYS2. Also the bash which supplied wih 'Git for Windows' is not a full version of bash hence does not provide for full Linux environment.

However you can get package manager support inside 'Git for Windows' in following ways :

  1. Install full MSYS2 and build Git for Windows yourself (Most git users don't require all packages and MSYS2)
  2. Install Git for Windows SDK (heavy & consumes around 3-5 Gb space)
  3. Use a hack to merge the MSYS2 Pacman packages with your existing Git for Windows installation

Alternative to Full Install: If you are installing MSYS2 or the Git WindowsSDK then best to use installer. However if you dont want to go for full install then you can try an alternative of obtaining the zipped package here - http://repo.msys2.org/msys/x86_64/  

Given below is the easiest method (bullet 3 above) to enable package manager (Pacman) support for an existing Git for Windows installation.


Merge MSYS2 Pacman Packages with Git for Windows installation

  1. Install Git for Windows SDK (Require approx 4 GB) or check 'Alternative to Full Install' above.
  2. Copy ${git-sdk}/usr/bin/pacman.exe to ${git}/usr/bin
  3. Copy ${git-sdk}/etc/pacman.conf to ${git}/etc
  4. Copy ${git-sdk}/etc/pacman.d to ${git}/etc
  5. Copy ${git-sdk}/var to ${git}/

DONE!!! Now you can use Pacman to install new packages from the MSYS2 Repository.


@dgleba
Copy link

dgleba commented Aug 8, 2021

I found this and forked it, made a couple changes and it works!

https://github.com/dgleba/gitportable-pacman

@adojos
Copy link
Author

adojos commented Sep 13, 2021

Glad you found it useful :)

@Phroneris
Copy link

Phroneris commented Apr 2, 2023

Currently the $-$ parts seem rendered as TeX/LaTeX mathematical expressions on GitHub.
They should be escaped or backquoted for Markdown display.
Thanks.

@adojos
Copy link
Author

adojos commented Apr 2, 2023

Hello Phroneris, thanks for reporting this, but I am afraid I am not able to figure out what you meant. I can see gist rendered perfectly on github. Attached is the screenshot of how I see it on github
https://snipboard.io/20gPnm.jpg

@Phroneris
Copy link

They were like this.

gist-dollar-markdown1

Now they seem correct.

gist-dollar-markdown2

I wonder it's because of the timing of GitHub's parser update...? I have no idea.
For safety, it would be recommended to backquote code parts especially containing some special characters.
Anyway it's fine now. Thanks.

@adojos
Copy link
Author

adojos commented Apr 2, 2023

Thanks for your response and re-checking. Umm... possibly some temp glitch somewhere maybe. Anyway, I appreciate your help. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment