Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can we use linux commands on windows through git?

Tags:

git

"We all use linux commands in git even in windows. I wanted to know how does it let these linux commands run on windows?"

like image 312
Sumit Dutta Avatar asked Mar 11 '26 16:03

Sumit Dutta


1 Answers

Simply add <c:\path\to\git\bin> to your %PATH% and you can use the Unix command packaged with msysgit.

For instance, ls or grep would work.

C:\prgs>which ls
C:\prgs\git\PortableGit-1.9.5-preview20141217\bin\ls.EXE

Those commands are part of the MinGw/msys project which provides a minimalist development environment for native Microsoft Windows applications.

That is what is used to build git itself, and its collection of Linux commands (as Windows executable).

See more at:

  • "Difference between msysgit and Cygwin + git?".
  • "What is the exact meaning of Git Bash?"
like image 200
VonC Avatar answered Mar 14 '26 23:03

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!