之后,我们键">
gpt4 book ai didi

git - 如何避免在每个 Git 命令的开头键入 "git"?

转载 作者:IT王子 更新时间:2023-10-29 01:15:59 27 4
gpt4 key购买 nike

我想知道是否有一种方法可以避免在每个 Git 命令的开头键入单词 git

如果有一种方法可以在打开命令提示符进入 “Git 模式” 后只使用一次 git 命令就好了。

例如:

git>

之后,我们键入的每个命令都默认解释为 Git 命令。

类似于我们使用 MySQL shell 编写数据库命令的方式:

mysql>

这将使我不必每天输入数百次 git

注意:我正在使用 git-bash , 在 Windows 上。

最佳答案

您可能想尝试 gitsh .来自他们的自述文件:

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$

或者看看那里链接的其他项目:

  • 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.

注意:我自己还没有用过。

关于git - 如何避免在每个 Git 命令的开头键入 "git"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56505000/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com