Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do you have to type "git" into git bash for each command?

Tags:

git

repository

git status
git add
git clone 
git push
git commit.... 

Why doesn't Git bash allow you to type git commands like:

status
add
clone
push

And then for all non git command type "nongit" or something

nongit cd
nongit ls...

or is this possible?

like image 763
Jake Graham Arnold Avatar asked Dec 11 '12 12:12

Jake Graham Arnold


3 Answers

This is so internal git commands no not clash with existing shell commands.

In modern CLI tools like git functionality is often broken into subtools which are invoked with an internal command. These commands can then take specific arguments which unclutters the tool interface. git status means "invoke the status command of git".

like image 135
Benjamin Bannier Avatar answered Nov 11 '22 21:11

Benjamin Bannier


Perhaps git-sh is what you're looking for: Check https://github.com/rtomayko/git-sh or install the Package git-sh in Debian/Ubuntu

like image 38
Dietrich Avatar answered Nov 11 '22 21:11

Dietrich


Maybe you could try out GIT Prompt:

http://volnitsky.com/project/git-prompt/

like image 40
pzkpfw Avatar answered Nov 11 '22 21:11

pzkpfw