Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relationship between Git Bash and Linux on a Windows computer?

I have installed Git Bash on my Windows machine. It behaves very differently from the normal command prompt.

Why is it this different? It seems to behave like Linux. Is it just the style of writing commands that is similar to Linux or is Linux included in Git Bash?

like image 817
user1283776 Avatar asked Mar 10 '26 13:03

user1283776


2 Answers

What is the relationship between Git Bash and Linux

The only relation between Linux and Bash is that Bash is often used on Linux systems (among others). Git Bash is just a Bash that's set up to be able to find the Git tools. This is generally not necessary on Linux systems (so you wouldn't find anything called Git Bash on a Linux system).

It behaves very differently from the normal command prompt.

It's a different shell (and a different terminal emulator).

It seems to behave like Linux.

Bash does indeed behave the same regardless of whether it runs on Windows or Linux (or OS X, BSD or any other operating system). However that's a property of Bash, not Linux.

is Linux included in Git Bash

No.

like image 184
sepp2k Avatar answered Mar 12 '26 03:03

sepp2k


git bash is a bash interpreter.

bash is a shell (bash is really an acronym for Bourne Again SHell), and it's a very popular shell on unix-like systems, uncluding Linux but also on other systems like OS-X.

But it doesn't include linux (it's basically a single binary; if you extract the cmd.exe from your w32 system, and give it to a friend, then you haven't given them Windows).

bash is very powerful, but it's real strength comes from the unix-philosophy of having many little tools that are good in doing (only) their job. the shell glues those tools together.

bash behaves very different than cmd because it is an interpreter for a different language. Just like python is different from java.

like image 43
umläute Avatar answered Mar 12 '26 02:03

umläute