Does "git mode" exist for bash?

2

Honestly, I'm not really sure how to put it, but here goes. Does anything like "modes" (git mode, for instance) exist for bash? What I mean is:

I'm using git through bash on Windows. I have ConEmu running just for this, with one tab for each repository I'm working in. This works quite well. However, I find it rather tedious always having to type git before each command. What I'm looking for, is something that allows me to, rather than typing

git status
git checkout mybranch
git pull

just typing

status
checkout mybranch
pull

I imagine this would work by entering a "git mode", before I start using git. Does anything like this exist?

torbonde

Posted 2018-08-15T07:55:55.353

Reputation: 123

Answers

2

I imagine this would work by entering a "git mode", before I start using git.

gitsh appears to meet your needs1:

The gitsh program is an interactive shell for git. From within gitsh you can issue any git command, even using your local aliases and configuration.

Git commands tend to come in groups. Avoid typing git over and over and over by running them in a dedicated git shell:

sh$ gitsh
gitsh% status
gitsh% add .
gitsh% commit -m "Ship it!"
gitsh% push
gitsh% ctrl-d
sh$

Source gitsh/README.md at master · thoughtbot/gitsh

1 Caveat - I haven't used it

DavidPostill

Posted 2018-08-15T07:55:55.353

Reputation: 118 938

This look really great! Only, I forgot to add that I'm running Windows, which apparantly isn't supported by gitsh. – torbonde – 2018-08-15T08:27:47.640

@torbonde If you install perl on Windows you can use https://github.com/caglar/gitsh

– DavidPostill – 2018-08-15T08:44:00.293