现在我使用 ubntu 17.10。
例如如何更改 git 命令
git add .
命令之类ga
的,git commit
命令之类的gc
git push
commans lije`gp
其他示例,例如 $ git add 命令,例如 $ ga
当我输入 ga 时,它就像 git add
考虑使用 Git 别名,例如
git config --global alias.co checkout
https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases
要准确实现您想要的,您可以使用 bash 别名
在您的 bash 提示符类型中
alias ga="git add ."
这仅在您关闭 shell 之前有效。要使您的别名保持不变,请将它们添加到您的 ~/.profile 文件中。
echo 'alias ga="git add ."' >> ~/.profile
Ubuntu 使用 ~/.profile 而不是 ~/.bash_profile。
祝你好运!
你想aliases
在你的 shell 中使用。对于重击:
echo "alias ga='git add .'" >> ~/.bash_profile
echo "alias gc='git commit'" >> ~/.bash_profile
echo "alias gp='git push'" >> ~/.bash_profile
或者,对于ZShell
echo "alias ga='git add .'" >> ~/.zshrc
echo "alias gc='git commit'" >> ~/.zshrc
echo "alias gp='git push'" >> ~/.zshrc
运行后,只需打开新终端即可。
如果我正确理解了您的问题,那么下面将详细说明如何使用别名