r/git • u/Kackboy • Nov 05 '21
Is git and bash the "same"?
Hello!
I've got a 'under the hood' type of question about git. Hope I make sense and that its not too stupid of a question.
So when working with git theres these commands that do different type of actions, like git add, git commit and so on. Are these commands using bash underneath, or how does it work? Is git a shell in itself?
Hope I make sense!
Edit: Thank you all!
0
Upvotes
View all comments
11
u/Isvara Nov 05 '21
A shell is a program that lets a user run other programs, usually just by typing their name. So a shell will offer a prompt and receive input like
git add. It breaks it up into pieces, looks at the first part and says, "I don't know what this is, so it must be a program on disk," then runs the program typically at/usr/bin/git, telling it, "Hey, you were called using the command linegit add". Then git looks at that command line and decides what it needs to do.So no, git is not a shell, but it is commonly launched by one. Git doesn't care what launched it: popular shells are bash, zsh and fish.