我如何避免在输入时输入“ git”在每个Git命令开始时? [英] How do I avoid typing "git" at the begining of every Git command?
问题描述
我想知道是否有一种方法可以避免在每个Git命令的开头都键入 git
这个词。
I'm wondering if there's a way to avoid having to type the word git
at the beginning of every Git command.
如果有一种方法可以在打开命令提示符进入 Git之后的开头只使用一次 git
命令,那将是很好的选择模式。
It would be nice if there was a way to use the git
command only once in the beginning after opening a command prompt to get into "Git mode".
例如:
git>
在此之后,我们键入的每个命令默认都被解释为Git命令。
After which every command we type is by default interpreted as a Git command.
类似于我们使用MySQL Shell编写数据库命令的方式:
In a way similar to how we use the MySQL shell to write database commands:
mysql>
这将使我不必键入 git
每天数百次。
This will save me from having to type git
hundreds of times a day.
注意:我正在使用 git-bash
。
NOTE: I'm using git-bash
, on Windows.
推荐答案
您可能想尝试 gitsh 。根据他们的自述文件:
You might want to try gitsh. From their readme:
gitsh
程序是git的交互式外壳。在gitsh
中,即使使用本地别名和配置,您也可以发出任何git命令。
The
gitsh
program is an interactive shell for git. From withingitsh
you can issue any git command, even using your local aliases and configuration.
- Git命令倾向于成组出现。通过在专用git shell中运行来避免一遍又一遍地输入
git
:
- 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.
这篇关于我如何避免在输入时输入“ git”在每个Git命令开始时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!