我想知道是否有一种方法可以避免在每个 Git 命令的开头键入单词 git
。
如果有一种方法可以在打开命令提示符进入 “Git 模式” 后只使用一次 git
命令就好了。
例如:
git>
之后,我们键入的每个命令都默认解释为 Git 命令。
类似于我们使用 MySQL shell 编写数据库命令的方式:
mysql>
这将使我不必每天输入数百次 git
。
注意:我正在使用 git-bash
, 在 Windows 上。
最佳答案
您可能想尝试 gitsh .来自他们的自述文件:
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 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$
或者看看那里链接的其他项目:
注意:我自己还没有用过。
关于git - 如何避免在每个 Git 命令的开头键入 "git"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56505000/