I tried the following and installed emacs to git-bash.. 1. Install msys2 somewhere(does not have to be same computer). 2. Under msys2, run the following:
cd /tmp mkdir -p var/lib cp -R /var/lib/pacman var/lib/ pacman -Sr /tmp emacs tar zcf emacs.tar.gz usr
Copy
emacs.tar.gz
to where you can access from git-bash, then under git-bash:tar zxf emacs.tar.gz -C / emacs
That's all, good luck.
After the first post, I tried an other computer but not working. It turns out that some dlls is missing in git-bash. Then I tested in a clean virtual machine with the following steps:
Install msys2-x86_64-20180531 and Git-2.19.1-64-bit.
Update msys2, open msys64 console and run:
pacman -Syyu
Close msys64 console when prompted, then run the above command again.
Get emacs files as the previous steps(run the following in msys64):
cd /tmpmkdir -p var/libcp -R /var/lib/pacman var/lib/pacman -Sr /tmp emacstar zcf emacs.tar.gz usrmv emacs.tar.gz /c/tmp
ps: I once tried the above steps in /d/tmp instead of /tmp and was not able to install emacs to it.
Open git-bash and extract emacs files:
cd /c/tmptar zxf emacs.tar.gz -C /
It will complain missing shared library "?" on trying to run emacs now. The "?" will not revealed to any readable
Go back to msys64 and get the msys2 dlls's:
ls --color=never /bin/*.dll > /c/tmp/1.txt
In git-bash compare dlls with msys:
cd /c/tmpgit initgit add 1.txt && git commitls --color=never /bin/*.dll | sed 's#\*$##g'> /c/tmp/1.txtgit diff 1.txt | grep '^-' | sed '1d' | sed 's#^-/bin/##g'> diff_dlls.txt
In my case, there are 26 dlls in diff_dlls.txt.
Copy the dlls from msys64 to git-bash:
In msys64:
mkdir /c/tmp/dllscat /c/tmp/diff_dlls.txt | xargs -I {} cp /bin/{} /c/tmp/dlls
In git-bash:
cp /c/tmp/dlls/* /bin
All done, now emacs runs in git-bash. Some of the 26 dlls may not be necessary, but I'd prefer to save my time instead of disk space.