'bash: git: command not found in MSYS

I already have git in my computer and I can use it.

I installed msys and:

pacman -Syu

This upgraded many packages. When I try to git clone in msys terminal, I get this response:

bash: git: command not found

How can I use git in MSYS?



Solution 1:[1]

I found an answer:

pacman -S git

Now I can use git in my mysy terminal.

Solution 2:[2]

If you downloaded "Git for Windows" then that installs MSYS2 but it's different to the MSYS you installed. They would not know about each other. You can merge the to as this guy writes (number 3): https://www.automationdojos.com/install-pacman-on-git-for-win-without-full-setup/

If you start fresh, the I would get MSYS2 first, then use pacman to install mingw64 toolchain and mingw64 version of git - which is what you get when you install "Git for Windows": https://gist.github.com/piotrkundu/e7d94204dd3c48525b23c59fe5d23478

pacman -S git will get you the MSYS version of git which runs with POSIX emulation (potentially slower).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tolga
Solution 2 Piotr Kundu