我想创建一个快捷方式来重新调整 x 提交数量:- git rebase -i HEAD~3。我有一个函数function gri() { git rebase --interactive HEAD~"$1"; },并尝试将其添加到我的 .zshrc 文件、.bashrc 和 .bash_profile 中。但是,例如,当我尝试运行时添加它时gri(2),我会收到错误zsh: command not found: gri(2)
解决了
只需要删除function,gri() { git rebase --interactive HEAD~"$1"; }就可以了:D