How do I avoid typing “git” at the begining of every Git command?

后端 未结 15 766
醉酒成梦
醉酒成梦 2021-01-29 22:31

I\'m wondering if there\'s a way to avoid having to type the word git at the beginning of every Git command.

It would be nice if there was a way to use the

15条回答
  •  一生所求
    2021-01-29 22:38

    You might want to try gitsh. From their readme:

    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$
    

    Or have a look at the other projects linked there:

    • git-sh - A customised bash shell with a Git prompt, aliases, and completion.
    • gitsh - A simple Git shell written in Perl.
    • repl - Wraps any program with subcommands in a REPL.

    Note: Haven't used this myself.

提交回复
热议问题