Quantcast
Channel: How to add more commands to Git Bash? - Super User
Viewing all articles
Browse latest Browse all 13

Answer by chenxin for How to add more commands to Git Bash?

$
0
0

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
  1. 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:

  1. Install msys2-x86_64-20180531 and Git-2.19.1-64-bit.

  2. Update msys2, open msys64 console and run:

    pacman -Syyu

    Close msys64 console when prompted, then run the above command again.

  3. 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.

  4. 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

  5. Go back to msys64 and get the msys2 dlls's:

    ls --color=never /bin/*.dll > /c/tmp/1.txt
  6. 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.

  7. 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
  8. 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.


Viewing all articles
Browse latest Browse all 13

Trending Articles